bsc

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

algo_013.md (494B)


      1 # algo_013
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to print the elements of a singly linked list in reverse order.
      6 
      7 ## Algorithm
      8 ```
      9 procedure reversePrint(head)
     10 begin   
     11     ptr ← head;
     12     stack ← createArray(10);
     13     i ← 0;
     14     while(ptr ≠ NULL)
     15         stack[i] ← info(ptr);
     16         i ← i + 1;
     17         ptr ← next(ptr);
     18     end while
     19     write("Elements in reverse order: ");
     20     while(i ≥ 0)
     21         write(stack[i]);
     22         i ← i - 1;
     23     end while
     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