Professional Documents
Culture Documents
CT DFS
CT DFS
CT DFS
CLASS TEST
M.TECH(CS) IYEAR
DATA STRUCTURES
1. Give an algorithm to find the 3rd smallest clement in a binary min-hcap in constant
time 3)
2. State what you mean by AVL property ofa node. Show that an
AVL tree withn nodes should
have O(lg n) height.
2+5=7]
3. Consider a binary search tree whOse nodes are labeled by A, B, C, D, E, F,G, H.
and pre-order travaersal of the tree yeilds the following sequence of
The in-order
nodes:
In-order: H, D, I, B, E, J, A, F, C, G, K
Pre-order: A, B, D, H, I, E, J,C, F, G, K
Answer the following questions. You need not provide explanations.
(a) Draw the tree.
(b) Assume that the tree is a valid binary search tree. What is the successor of node A.
(c) Is the tree an AVL tree?
(d) Re-draw the tree after deleting node C.
(e) Is this new tree an AVL tree?