3 marksAbstract Data Types (ADTs)
CAPE Computer Science Unit 2 · 2016 · Paper 2 · Question 1(c)
An empty queue Q of size 5 executes a sequence of operations: Line 1: Q.enqueue ('A'); Line 2: Q.enqueue ('B'); Line 3: Q.enqueue ('C'); Line 4: Char c = Q.dequeue ( ); Line 5: Q.enqueue ('A');
Draw diagrams showing the contents of the queue Q after executing Line 3, Line 4, and Line 5, showing all elements in the queue for each illustration.
The mark scheme is shown once you've answered.
Practise this question