- Problem You Need To Write A Recursive Algorithm That Reverses A Queue You Should Only Use The Following Queue Interfac 1 (31.82 KiB) Viewed 31 times
Problem: You need to write a recursive algorithm that reverses a Queue. You should only use the following Queue interfac
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Problem: You need to write a recursive algorithm that reverses a Queue. You should only use the following Queue interfac
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