wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

31st

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the maximum height of any AVL-tree with 7 nodes? Assume that the height of a tree with a single node is 0.

a)

2

b)

3

c)

4

d)

5

2.

The sequence of insertion 10,12,14 will lead to imbalance by using which rotation can be used to balance the tree

a)

RR rotation

b)

LL rotation

c)

LR rotation

d)

RL rotation

3.

The sequence of insertion 25,12,9 will lead to imbalance by using which rotation can be used to balance the tree

a)

RR rotation

b)

LL rotation

c)

RL rotation

d)

LR rotation

4.

AVL trees are used when you have

a)

a) Huge number of searching operations

b)

b) fewer insertion and deletion operation

c)

c) you want guaranteed search time of O(log n)

d)

d) all options are correct

5.

The sequence of insertion 25,12,18 will lead to imbalance by using which rotation can be used to balance the tree

a)

LL followed by RR

b)

RR followed by LL

c)

LL followed by LL

d)

RR followed by RR

6.
Red-black trees use color to ensure…
a)
O(h) recolorings and O(1) restructurings
b)
O(1) recolorings and O(h) restructurings
c)
O(log n) restructurings for each insert
d)
O(log n) restructurings for each delete
7.

_____________is the method used by card sorter?

a)

Radix sort

b)

Insertion

c)

Heap

d)

Quick

8.

How many possible solutions exist for an 8-queen problem?

a)

100

b)

98

c)

92

d)

88

9.

In n-queen problem, how many values of n does not provide an optimal solution?

a)

1

b)

2

c)

3

d)

4

10.
Which type of sort algorithm is this?
a)

Insertion

b)

Merge

c)

Bubble

d)

Selection