bsc

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

root / semester_2 / algorithms / algo_039.md

algo_039.md (569B)


      1 # algo_039
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to dequeue (circular queue)
      6 
      7 ## Algorithm
      8 ```
      9 procedure dequeue(Q[], front, rear)
     10 begin
     11     if(front = -1)
     12         write("Queue empty.");
     13     else
     14         rear ← Q[front];
     15         write("Deleted element: ", val);
     16       --------------------------------
     17       | front ← (front + 1) % Qsize; |
     18       | if(front > rear)             |   Vice Versa
     19       |     front ← -1;              |
     20       |     rear ← -1;               |
     21       --------------------------------    
     22         endif
     23     endif
     24 end procedure
     25 ```
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror