Computer Science, asked by shawsubham952, 5 months ago

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