bsc

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

algo_024.md (473B)


      1 # algo_024
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to delete the first node of double linked list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure delete_firstnode(dl)
     10 begin
     11     if(dl = NULL)
     12         write("list is empty, deletion not possible");
     13     else
     14         ptr ← dl;
     15         if(next(ptr) = NULL)
     16             dl ← next(ptr);
     17         else
     18             dl ← next(ptr);
     19             prev(dl) ← NULL;
     20         end if
     21         delete(ptr);
     22     endif
     23     return(dl);
     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