bsc

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

root / semester_2 / algorithms / algo_013.md

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