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_016.md

algo_016.md (402B)


      1 # algo_016
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to traverse or display a circular linked list.
      6 
      7 ## Algorithm
      8 ```
      9 procedure display(cl)
     10 begin
     11     if(cl = NULL)
     12         write("The list is empty.");
     13     else
     14         ptr ← next(cl); //Points to the first node.
     15         do{
     16             write(info(ptr));
     17             ptr ← next(ptr);
     18         } while(ptr ≠ next(cl));
     19     endif
     20 end procedure
     21 ```