Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Queue

Total questions: 20

Worksheet time: 13mins

Name
Class
Date
1.

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

a)

At the head of link list

b)

At the centre position in the link list

c)

At the tail of the link list

d)

None of the mentioned

2.

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

a)

FRONT is null

b)

REAR is null

c)

LINK is empty

d)

None of the mentioned

3.

In a circular queue, how do you increment the rear end of the queue?

a)

rear++

b)

(rear+1) % Number of Item

c)

(rear % Number of Item)+1

d)

rear–

4.

Which is the application of a queue?

a)

CPU allocation

b)

Sharing printer

c)

Graph traversal

d)

All

5.

If REAR, FRONT are the queue variables, then identify correct statement while inserting a value

a)

FRONT=1

b)

REAR=REAR+1

c)

REAR=REAR-1

d)

FRONT=FRONT-1

6.

If elements are inserted in the order -10,-2,-3,4,-1,6 then to delete value -3 how many dequeue operations are required?

(a)  

7.

Time complexity of enqueue is

a)

O(n)

b)

O(1)

c)

O(nlogn)

d)

O(logn)

8.

Number of queues required to implement a stack is

a)

1

b)

2

c)

3

d)

cannot be implemented

9.

A circular queue is implemented using an array of size 10. The array index starts with 0, front is 6, and rear is 9. The insertion of next element takes place at the array index

a)

7

b)

9

c)

10

d)

0

10.

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

a)

At the head of link list

b)

At the centre position in the link list

c)

At the tail of the link list

d)

None of the mentioned

11.

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

a)

At the head of link list

b)

At the centre position in the link list

c)

At the tail of the link list

d)

None of the mentioned

12.

Let the following circular queue can accommodate maximum six elements with the following data


front = 2 rear = 4

queue = _______; L, M, N, ___, ___


What will happen after ADD O operation takes place?

a)

front = 2 rear = 5

queue = ______; L, M, N, O, ___

b)

front = 3 rear = 5

queue = L, M, N, O, ___

c)

front = 3 rear = 4

queue = ______; L, M, N, O, ___

d)

front = 2 rear = 4

queue = L, M, N, O, ___

13.

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

14.

One difference between a queue and a stack is:

a)

Queues require dynamic memory, but stacks do not

b)

Stacks require dynamic memory, but queues do not.

c)

Queues use two ends of the structure; stacks use only one.

d)

Stacks use two ends of the structure, queues use only one.

15.

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

16.

The essential condition which is checked before insertion in a linked queue is?

a)

Underflow

b)

Overflow

c)

Front value

d)

Rear value

17.

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

18.

If front=rear ,then the queue is?

a)

full

b)

undeflow

c)

overflow

d)

empty

19.

Insertion operation is done at only one end and

deletion operation is done at both the ends

a)

Input Restricted Queue

b)

Output Restricted Queue

c)

Priority Queue

d)

None of these

20.

Deletion operation is done at only one end and insertion

operation is done at both the ends

a)

Input Restricted Queue

b)

Output Restricted Queue

c)

Priority Queue

d)

None of these