wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AVL Trees

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

The balancing factor for AVL tree =

a)

hL-hR

b)

hR-hL

c)

hL-hL

d)

hR-hR

2.

The allowed values for balancing factor of a node in an AVL tree

a)

0,1

b)

2,0,-2

c)

0,1,2

d)

-1,0,1

3.

For RL imbalance which rotation is need to balance the tree

a)

Single LL rotation

b)

Single RR rotation

c)

LL and RR rotation

d)

None

4.

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

5.

After an insertion or deletion operation in an AVL tree the first node with an invalid balancing factor is called............

a)

nodes

b)

invalid node

c)

node

d)

critical node

6.

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

7.

Why we need to a binary tree which is height balanced?

a)

a) to avoid formation of skew trees

b)

b) to save memory

c)

c) to attain faster memory access

d)

d) to simplify storing

8.

What is the maximum height of an AVL tree with p nodes?

a)

a) p

b)

b) log(p)

c)

c) log(p)/2

d)

d) p⁄2

9.

In an AVL tree, what is the primary purpose of performing a trinode restructuring?

a)

to maintain the height-balance property

b)

to increase the height of the tree

c)

to reduce the number of nodes

d)

to rearrange the nodes in a level order

10.

Is the following tree an AVL tree?

a)

no

b)

yes

11.

Is the following tree an AVL tree?

a)

yes

b)

no

12.

After deleting the left child of 10 (now replaced with a sentinel node in the tree below). What node should be labeled as a critical node?

a)

10

b)

12

c)

15

d)

20

13.

This tree is...

a)

Balanced

b)

Unbalanced

14.

What is the Balance Factor of the node with the value 15?

(a)  

15.

What is the Balance Factor of the node with the value 15?

(a)  

16.

What is the Balance Factor of the node with the value 345?

(a)  

17.

AVL tree got its name after its

a)

Adelson-Velsky and Landis

b)

Adam Velsky Lenin

c)

Adelson Vel Landis

d)

None

18.

Which of the following are example of single rotation

a)

LL

b)

RR

c)

LR

d)

RL

19.

The sequence of insertion 250,332,280 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

20.
What is the worst-case height of an AVL tree?
a)
O(log n)
b)
O(n)
c)
O(n logn)
d)
O(1)