bsc

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

algo_015.md (432B)


      1 # algo_015
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to insert a node at the beginning of a circular linked list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure insertBegin(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 = NULL) 
     17         cl ← ptr;
     18     else 
     19         next(ptr) ← next(cl);
     20         next(cl) ← ptr;
     21     endif
     22     return(cl);
     23 end procedure
     24 ```
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror