wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

DS-U2-QUIZ2

Total questions: 12

Worksheet time: 12mins

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 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

3.

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

4.

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, ___

5.

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

6.

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

a)

Underflow

b)

Overflow

c)

Front value

d)

Rear value

7.

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

8.

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

9.

One difference between a queue and a stack is:

a)

Queues require linked lists, but stacks do not.

b)

Stacks require linked lists, 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.

10.

The postfix form of the expression (A+ B)*(C*D- E)*F / G is?

a)

AB + CDE * - * F *G /

b)

AB+ CD*E - FG /**

c)

AB + CD* E - F **G /

d)

AB + CD* E - *F *G /

11.

The prefix form of A-B/ (C * (D * E)) is?

a)

-/*ACB*DE

b)

-ABCD**DE

c)

-A/B*C*DE

d)

-A/BC**DE

12.

Convert the following Infix expression to Postfix form using a stack


x + y * z + (p * q + r) * s

a)

xyz*+pq*r+s*+

b)

xyz*+pq*r+s+*

c)

xyz+*pq*r+s*+

d)

none