WorksheetsQueue ADT
Total questions: 20
Worksheet time: 30mins
If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
ABCD
DCBA
DCAB
ABDC
In the implementation of a queue, where does a new element be inserted?
At the the front of the array
At the centre position of the array
At the end of the array
None of the mentioned
In the implementation of a queue, from where is the item deleted?
At the front of the array
At the centre position of the array
At the end of the array
None of the mentioned
In linked list implementation of a queue, the important condition for a queue to be initially empty is?
FRONT is null
REAR is null
LINK is empty
None of the mentioned
What is the term for inserting into a full queue known as?
overflow
underflow
null pointer exception
all of the mentioned
What is the reason for using a "circular queue" instead of a regular one?
running time of enqueue() is improved
reuse empty spaces
you can traverse all the elements more efficiently
none of the above
If the numbers 5, 10, 3, 42 are enqueued onto a queue in that order, what does dequeue return?
5
10
3
42
A queue of characters currently contained a,b,c,d. What would be the contents of queue after the following operationDELETE, ADD W, ADD X, DELETE, ADD Y.
A,B,C,W,Y
A,B,C,D,W
C,D,W,X,Y
W,Y,X,C,D
If front=rear ,then the queue is?
full
undeflow
overflow
empty
A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Rear" index pointer point?
0
1
2
3
A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Front" pointer point?
Bert
Cynthia
Cedric
Albert
Select ALL the situations that a Queue data structure would be used?
Printer in a room full of computers
Characters typed on a keyboard
Back Button
Undo Button
Which is the correct operation for:
"Add a item to the rear of the queue."
enQueue(item)
Append.Queue(item)
enQueue()
AddItem(EnQueue())
Select operations that can be performed on a Queue Data Structure...
isEmpty()
pop()
push()
isFull()
Append(Item)
Where would pointers be pointing if...
- Eli leaves the Queue
- Adam joins the Queue
front = 0 rear = 3
front = 1 rear = 4
front = 2 rear = 3
front = 0 rear = 4
front = 0 rear = 4
Where would pointers be pointing if...
- Eli leaves the Queue.
- Hanna joins the Queue.
- Adam joins the Queue.
- Jason leaves the Queue.
front = 0 rear = 5
front = 1 rear = 4
front = 2 rear = 4
front = 0 rear = 4
front = 2 rear = 5
Suppose you have the following series of queue operations.
q = Queue();
q.enqueue('hello');
q.enqueue('dog');
q.enqueue(3);
q.dequeue();
What items are left on the queue?
'hello', 'dog'
'dog', 3
'hello', 3
'hello', 'dog', 3
In Queues, we can insert an element at ___ end and can delete an element at ____ end.
REAR,FRONT
FRONT,REAR
TOP,BOTTOM
BOTTOM, TOP
What would happen if...
deQueue()
enQueue(Hanna)
enQueue(Steve)
enQueue(Jack)
front = 1 rear = 0
*and Steve would be unable to be added.
front = 1 rear = 5
*and Jack would be unable to be added
front = 0 rear = 5
front = 0 rear = 4
front = 1 rear = 4
