Question: Q 4 . ( a ) Draw the Binary Search Tree ( BST ) if the following values are inserted into a tree from left
Qa Draw the Binary Search Tree BST if the following values are inserted into a
tree from left to right one at a time. The tree is empty before the first value is
inserted.
b The following questions bi and bii are based on the Binary Search Tree
BST drawn in Qa
i Redraw the tree after node is deleted.
ii State whether the Binary Search Tree in Qabefore deletion is an
AVL tree? If not, specify which node is not balanced and identify the
unbalance pattern eg LL LR LB RR RB RL Draw the tree after
the balancing.
c Assume that we have numbers between and in a Binary Search Tree
BST and want to search for the number State whether the examination of
the following sequences for the nodes is valid or not in order to find and
justify your answer.
i
ii
iii
d Write a recursive function int TreeHeightBTNode nodePtr to return the
height of a Binary Search Tree BSTHelp
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
