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 ```