WorksheetsAVL Trees
Total questions: 20
Worksheet time: 10mins
The balancing factor for AVL tree =
hL-hR
hR-hL
hL-hL
hR-hR
The allowed values for balancing factor of a node in an AVL tree
0,1
2,0,-2
0,1,2
-1,0,1
For RL imbalance which rotation is need to balance the tree
Single LL rotation
Single RR rotation
LL and RR rotation
None
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.
2
3
4
5
After an insertion or deletion operation in an AVL tree the first node with an invalid balancing factor is called............
nodes
invalid node
node
critical node
The sequence of insertion 25,12,18 will lead to imbalance by using which rotation can be used to balance the tree
LL followed by RR
RR followed by LL
LL followed by LL
RR followed by RR
Why we need to a binary tree which is height balanced?
a) to avoid formation of skew trees
b) to save memory
c) to attain faster memory access
d) to simplify storing
What is the maximum height of an AVL tree with p nodes?
a) p
b) log(p)
c) log(p)/2
d) p⁄2
In an AVL tree, what is the primary purpose of performing a trinode restructuring?
to maintain the height-balance property
to increase the height of the tree
to reduce the number of nodes
to rearrange the nodes in a level order
Is the following tree an AVL tree?
no
yes
Is the following tree an AVL tree?
yes
no
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?
10
12
15
20
This tree is...
Balanced
Unbalanced
What is the Balance Factor of the node with the value 15?
(a)
What is the Balance Factor of the node with the value 15?
(a)
What is the Balance Factor of the node with the value 345?
(a)
AVL tree got its name after its
Adelson-Velsky and Landis
Adam Velsky Lenin
Adelson Vel Landis
None
Which of the following are example of single rotation
LL
RR
LR
RL
The sequence of insertion 250,332,280 will lead to imbalance by using which rotation can be used to balance the tree
LL followed by RR
RR followed by LL
LL followed by LL
RR followed by RR
