Problem: You need to write a recursive algorithm that reverses a Queue. You should only use the following Queue interfac
Posted: Mon Jun 06, 2022 2:24 pm
Problem: You need to write a recursive algorithm that reverses a Queue. You should only use the following Queue interfaces. .add(e): enqueues element e on to the queue .remove(): dequeues and returns the element at the front of the queue isEmpty(): retiurns true if and only if the queue has no elements Hint: the solution is only 4-5 lines long. input: Q Queue that is to be reversed output: A queue with the elements in reversed order // Your pseudo code here