bsc

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

root / semester_2 / algorithms / algo_042.md

algo_042.md (424B)


      1 # algo_042
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to enqueue an element into a circular queue using linked representation.
      6 
      7 ## Algorithm
      8 ```
      9 procedure enqueue(cq, val)
     10 begin
     11     ptr ← getNode();
     12     info(ptr) ← val;
     13     next(ptr) ← ptr;
     14     if (cq = NULL) then
     15         cq ← ptr;
     16     else
     17         next(ptr) ← next(cq);
     18         next(cq) ← ptr;
     19         cq ← ptr;
     20     endif
     21     return(cq);
     22 end procedure
     23 ```
© 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