bsc

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

algo_005.md (467B)


      1 # algo_005
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to insert a node at the end of the list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure insertEnd(head)
     10 begin
     11     nptr ← getnode();
     12     write("Enter info: ");
     13     read(val);
     14     info(nptr) ← val;
     15     if(head = NULL)
     16         head ← nptr;
     17     else
     18         ptr ← head;
     19         while(next(ptr) ≠ NULL)
     20             ptr ← next(ptr);
     21         end while
     22         next(ptr) ← nptr;
     23     endif
     24     return(head);
     25 end procedure
     26 ```
© 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