bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_2 / algorithms / algo_014.md

algo_014.md (422B)


      1 # algo_014
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to insert an element at the end of a circular linked list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure insertEnd(cl)
     10 begin
     11     ptr ← getNode();
     12     write("Enter the value: ");
     13     read(val);
     14     info(ptr) ← val;
     15     next(ptr) ← ptr;
     16     if(cl) // cl ≠ NULL
     17         next(ptr) ← next(cl);
     18         next(cl) ← ptr;
     19     endif
     20     cl ← ptr;
     21     return(cl);
     22 end procedure
     23 ```
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror