wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

New DSC Quiz

Total questions: 20

Worksheet time: 30mins

Name
Class
Date
1.

What is the outcome of this postfix expression assuming single digit operand 4 3 2 + * 5 6+ * ?

 

a)

220

b)

106

c)

28

d)

26

2.

If the elements '1', '2', '3' and '4' are added in a stack, so what would be the order for the removal?

a)

1234

b)

2134

c)

4321

d)

none

3.

In the linked list implementation of queue, where will the new element be inserted?

 

a)

At the middle position of the linked list

 

b)

At the head position of the linked list

c)

At the tail position of the linked list

d)

anywhere

4.

What would be the output given by display, after performing the following operations in a Double ended queue ?

Insertfront(10) ,Insertrear(30),deletefront(), ,Insertrear(40), deletefront(),deleterear(), Display(); Insertfront(20)

a)

10, 30 ,40

b)

30 ,40

c)

20

d)

none of them

5.

What should be the initial values of top of first and second stack that are implemented using single array of size max

a)

-1 and max-1

b)

0 and max-1

 

c)

-1 and max

d)

0 and max

6.

How many nodes a complete binary tree will have at level L?

a)

2L-1

b)

2L

c)

2L+1

d)

2*L

7.

Which of the following is true with respect to a graph that is strongly connected?

a)

only if every node is connected to every other node directly by an edge

b)

it is applicable to only directed graph

c)

if we can reach every node from every other node in a graph

d)

none of them

8.

Maximum and minimum number of nodes that can be fit in a binary tree of height 5 is

 

a)

64,4

b)

5,31

c)

16,5

d)

31,5

9.

What will be the length of the message " all the best 1 " ,if encoded using Huffmann techinque assuming vowels length as 3 and all others as 5?

a)

64

b)

59

c)

49

d)

74

10.

Choose most appropriate one , Binary tree is balanced only if balance factor is

a)

all the above

b)

-1

c)

1

d)

0

11.

Fill the blank with most appropriate choice , In a binary search tree, the root node element   ____________is element in right subtree

a)

greater than

b)

greater than or equal to

c)

less than or equal to

d)

less than

12.

Which of the following is essential for converting an infix expression to the postfix form efficiently?

a)

an operator stack

b)

an operand stack

c)

an operator and operator stack

d)

parse tree

13.

What is the minimum number of stacks of size n required to implement a queue of size n?

a)

one

b)

Two

c)

Three

d)

four

14.

The following postfix expression 8 6 + 2 9 + * with single digit operands is evaluated using a stack. The top two elements of the stack after the first + is evaluated are:

 

a)

8, 6

b)

14,2

c)

6 ,8

d)

14

15.

If the preorder and inorder traversal of binary tree are 10 ,5, 6, 11, 8, 9 and 6, 5 11 ,10, 9, 8 what would be postorder sequence?

a)

6,11,9,5,8,10

b)

6,5,9,8,11,10

c)

6,11,8,5,9,10

d)

6,11,5,9,8,10

16.

What is the balance factor at the root node of this binary tree

a)

0

b)

2

c)

1

d)

-1

17.

Which of these following statements are true

a)all tree can be graph

b)all graph cannot be tree

 

a)

only a

b)

only b

c)

both true

d)

both false

18.

The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 15, 12, 10. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)?

a)

2

b)

4

c)

6

d)

3

19.

For breadth first traversal which data structure is needed?

a)

array

b)

list

c)

stack

d)

queue

20.

If ,In priority queue, elements are stored in accordance with priority(higher) which of thefollowing is/are correct?

a)enqueue is complex

b) dequeue is complex

c) enqueue is simple

d) dequeue is simple

a)

a

b)

b

c)

c

d)

d