bsc

Comprehensive codebase and coursework for the 4-year B.Sc. Computer Science Honours degree (WBSU)

git clone https://github.com/notamitgamer/bsc.git
· rebuilt hourlyOpen on GitHub
root / semester_2 / algorithms / algo_002.md

algo_002.md (351B)


      1 # algo_002
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to delete the first node of the list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure delete_firstNode(head)
     10 begin
     11     if(head = NULL)
     12         write("List is empty, Deletion is not possible.");
     13     else 
     14         p ← head ;
     15         head ← next(p);
     16         delete(p);
     17     endif
     18     return(head);
     19 end procedure
     20 ```