bsc

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

algo_011.md (332B)


      1 # algo_011
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to reverse a linked list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure reverse(head)
     10 begin 
     11     q ← r ← NULL;
     12     while(head ≠ NULL)
     13         r ← q;
     14         q ← head;
     15         head ← next(head);
     16         next(q) ← r;
     17     end while
     18     head ← q;
     19     return(head);
     20 end procedure
     21 ```
© 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