bsc

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

root / semester_2 / algorithms / algo_018.md

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-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