bsc

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

algo_017.md (472B)


      1 # algo_017
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to merge two sorted circular linked list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure merge(cl1, cl2)
     10 begin
     11     if(cl1 = NULL && cl2 = NULL) 
     12         return(cl1);
     13     else if(cl1 ≠ NULL && cl2 = NULL) 
     14         return(cl1);
     15     else if(cl1 = NULL && cl2 ≠ NULL) 
     16         return(cl2);
     17     else 
     18         ptr ← next(cl2);
     19         next(cl2) ← next(cl1);
     20         next(cl1) ← ptr;
     21         return(cl2);
     22     endif
     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