bsc

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

root / semester_2 / algorithms / algo_034.md

algo_034.md (407B)


      1 # algo_034
      2 
      3 ### Problem Statement
      4 
      5 > Write an algorithm to enqueue.
      6 
      7 ## Algorithm
      8 ```
      9 procedure enqueue(rear, MAX, front, Q[], val)
     10 begin
     11     if(rear = MAX - 1)
     12         write("Queue full, insertion can't be done.");
     13     else
     14         if(front = -1)
     15             front ← 0;
     16         endif 
     17         rear ← rear + 1;
     18         Q[rear] ← val;
     19         write("Inserted element", val);
     20     endif
     21 end procedure
     22 ```
© 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