Write a function, reverse_queue(q), which takes a Queue, q as a parameter and modifies the queue so that the elements in the queue are rearranged into order.
Answers
Answered by
0
Explanation:
Give an algorithm for reversing a queue Q. Only following standard operations are allowed on queue.
enqueue(x) : Add an item x to rear of queue.
dequeue() : Remove an item from front of queue.
empty() : Checks if a queue is empty or not.
Similar questions