Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Queue ADT

Total questions: 20

Worksheet time: 30mins

Name
Class
Date
1.

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?

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

2.

In the implementation of a queue, where does a new element be inserted?

a)

At the the front of the array

b)

At the centre position of the array

c)

At the end of the array

d)

None of the mentioned

3.

In the implementation of a queue, from where is the item deleted?

a)

At the front of the array

b)

At the centre position of the array

c)

At the end of the array

d)

None of the mentioned

4.

In linked list implementation of a queue, the important condition for a queue to be initially empty is?

a)

FRONT is null

b)

REAR is null

c)

LINK is empty

d)

None of the mentioned

5.

What is the term for inserting into a full queue known as?

a)

overflow

b)

underflow

c)

null pointer exception

d)

all of the mentioned

6.

What is the reason for using a "circular queue" instead of a regular one?

a)

running time of enqueue() is improved

b)

reuse empty spaces

c)

you can traverse all the elements more efficiently

d)

none of the above

7.

If the numbers 5, 10, 3, 42 are enqueued onto a queue in that order, what does dequeue return?

a)

5

b)

10

c)

3

d)

42

8.

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)

A,B,C,W,Y

b)

A,B,C,D,W

c)

C,D,W,X,Y

d)

W,Y,X,C,D

9.

If front=rear ,then the queue is?

a)

full

b)

undeflow

c)

overflow

d)

empty

10.
Which of these data structures is FIFO? 
a)
Stack
b)
Queue
c)
Binary Tree
d)
Double linked list
11.

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?

a)

0

b)

1

c)

2

d)

3

12.

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?

a)

Bert

b)

Cynthia

c)

Cedric

d)

Albert

13.

Select ALL the situations that a Queue data structure would be used?

a)

Printer in a room full of computers

b)

Characters typed on a keyboard

c)

Back Button

d)

Undo Button

14.

Which is the correct operation for:

"Add a item to the rear of the queue."

a)

enQueue(item)

b)

Append.Queue(item)

c)

enQueue()

d)

AddItem(EnQueue())

15.

Select operations that can be performed on a Queue Data Structure...

a)

isEmpty()

b)

pop()

c)

push()

d)

isFull()

e)

Append(Item)

16.

Where would pointers be pointing if...

  1. Eli leaves the Queue
  2. Adam joins the Queue
a)

front = 0 rear = 3

b)

front = 1 rear = 4

c)

front = 2 rear = 3

d)

front = 0 rear = 4

e)

front = 0 rear = 4

17.

Where would pointers be pointing if...

  1. Eli leaves the Queue.
  2. Hanna joins the Queue.
  3. Adam joins the Queue.
  4. Jason leaves the Queue.
a)

front = 0 rear = 5

b)

front = 1 rear = 4

c)

front = 2 rear = 4

d)

front = 0 rear = 4

e)

front = 2 rear = 5

18.

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?

a)

'hello', 'dog'

b)

'dog', 3

c)

'hello', 3

d)

'hello', 'dog', 3

19.

In Queues, we can insert an element at ___ end and can delete an element at ____ end.

a)

REAR,FRONT

b)

FRONT,REAR

c)

TOP,BOTTOM

d)

BOTTOM, TOP

20.

What would happen if...

deQueue()

enQueue(Hanna)

enQueue(Steve)

enQueue(Jack)

a)

front = 1 rear = 0

*and Steve would be unable to be added.

b)

front = 1 rear = 5

*and Jack would be unable to be added

c)

front = 0 rear = 5

d)

front = 0 rear = 4

e)

front = 1 rear = 4