6 marksAbstract Data Types (ADTs)
CAPE Computer Science Unit 2 · 2010 · Paper 2 · Question 1(d)
Given a queue q with elements, and stack stk with operations pop, push, and isEmpty, write an algorithm to reverse the order of all elements in q using only Stack and Queue ADT operations.
The mark scheme is shown once you've answered.
Practise this question