wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Structure

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

Which value is assigned/set at front and rear ends during the Initialization of a Queue?

a)

a. 0

b)

b. 1

c)

c. - 1

d)

d. infinity

2.

What should be the value of rear (end) if the queue is full (elements are completely occupied )?

a)

a. 1

b)

b. - 1

c)

c. MAX + 1

d)

d. MAX - 1

3.

Which among the below specified condition is applicable if the Queue is non - empty?

a)

a. rear > front

b)

b. rear < front

c)

c. rear = front

d)

d. Unpredictable

4.

Convert the following Infix expression to Postfix form using a stack

x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.

a)

a) xyz*+pq*r+s*+

b)

b) xyz*+pq*r+s+*

c)

c) xyz+*pq*r+s*+

d)

d) xyzp+**qr+s*+

5.

Consider the following operation performed on a stack of size 5.

Push(1);

Pop();

Push(2);

Push(3);

Pop();

Push(4);

Pop();

Pop();

Push(5);

After the completion of all operation, the number of elements present in stack are

a)

a)1

b)

b)2

c)

c)3

d)

d)4

6.

Maximum degree of any vertex in a simple graph of vertices n is

a)

A - 2n - 1

b)

B - n

c)

C - n + 1

d)

D - n - 1

7.

Which of the following is useful in traversing a given graph by breadth first search?

a)

Op 1: stack

b)

Op 2: set

c)

Op 3: list

d)

Op 4: queue

8.

Which of the following abstract data types can be used to represent a many to-many relation?

a)

Op 1: Tree

b)

Op 2: Stack

c)

Op 3: Graph

d)

Op 4: Queue

9.

Two lists, A and B are implemented as singly linked link-lists. The address of the first and last node are stored in variables firstA and lastA for list A and firstB and lastB for list B. Given the address of a node is given in the

variable node, the element stored in the node can be accessed by the

statement node->data and the address to the next node can be accessed by node->next. Pankaj wants to append list B at end of list A. Which of the following

statements should he use?

a)

Op 1: lastB -> next = firstA

b)

Op 2: lastA = firstB

c)

Op 3: lastA->next = firstB

d)

Op 4: lastB = firstA

10.

A complete binary tree with 5 levels has how many nodes? (Root is Level 1)

a)

Op 1: 15

b)

Op 2: 25

c)

Op 3: 63

d)

Op 4: 31

11.

The maximum number of nodes on level I of a binary tree is which of the

following? (Root is Level 1)

a)

Op 1: 2^l-1

b)

Op 2: 3^l-1

c)

Op 3: 2^l

d)

Op 4: 2^l - 1

12.

Surbhi wants to implement a particular data structure using a static array. She uses the concept of circular list to implement the data structure, because this allows her to efficiently use all fields of the array. Which data structure is Surbhi implementing?

a)

Op 1: a stack

b)

Op 2: a queue

c)

Op 3: Binary Tree

d)

Op 4: None of these

13.

Number of possible ordered trees with 3 nodes A, B, C is

a)

Op 1: 16

b)

Op 2: 12

c)

Op 3: 13

d)

Op 4: 14