bsc

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

algo_008.md (461B)


      1 # algo_008
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to find max element from the list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure findMax(head)
     10 begin
     11     if(head = NULL)
     12         write("List is empty.");
     13     else 
     14         ptr ← head;
     15         max ← info(ptr);
     16         while(ptr ≠ NULL)
     17             if(max < info(ptr))
     18                 max ← info(ptr);
     19             endif
     20             ptr ← next(ptr);
     21         end while
     22         return(max);
     23     endif
     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