bsc

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

algo_018.md (453B)


      1 # algo_018
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to delete the first node of the circular linked list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure delFirst(cl)
     10 begin
     11     if(cl = NULL)
     12         write("Nothing to delete.");
     13     else
     14         ptr ← next(cl);
     15         if(ptr = cl)
     16             delete(ptr);
     17             cl ← NULL;
     18         else
     19             next(cl) ← next(ptr);
     20             delete(ptr);
     21         endif
     22         return(cl);
     23     endif
     24 end procedure
     25 ```
© 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