While inserting the elements in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is
View worked solution
Answer: B
To find the element at the lowest (deepest) level, we insert the elements into an initially empty Binary Search Tree (BST) one by one in the given sequence: .
Recall the BST insertion rule: for any node, elements smaller than the node go to its left subtree, and elements larger go to its right subtree.
- Insert : This becomes the root node.
71 (Level 0) - Insert : Since , it becomes the left child of .
71 (Level 0) / 65 (Level 1) - Insert : Since , it becomes the right child of .
71 (Level 0) / \ 65 84 (Level 1) - Insert :
- go left to
- right child of
71 (Level 0) / \ 65 84 (Level 1) \ 69 (Level 2) - Insert :
- go left to
- go right to
- left child of
71 (Level 0) / \ 65 84 (Level 1) \ 69 (Level 2) / 67 (Level 3) - Insert :
- go right to
- left child of
71 (Level 0) / \ 65 84 (Level 1) \ / 69 83 (Level 2) / 67 (Level 3)
Summarizing the levels of each node:
- Level 0:
- Level 1:
- Level 2:
- Level 3:
The element at the lowest level (deepest level) is .
Free practice · Your answers on this page are not saved.
