In a binary search tree, which subtree of a node contains elements that are greater than the node’s value?
Options
- A. Left subtree
- B. Right subtree
- C. Both subtrees
- D. More than one of the above
- E. None of the above
B. Right subtree
In a Binary Search Tree (BST), the elements follow a specific rule:
Left subtree → contains elements less than the node value
Right subtree → contains elements greater than the node value
Example:
50
/ \
30 70
/ \ / \
20 40 60 80
Values 20, 30, 40 are less than 50 → stored in the left subtree
Values 60, 70, 80 are greater than 50 → stored in the right subtree
(A) Left subtree → smaller values ❌
(B) Right subtree → greater values ✅
(C) Both subtrees ❌
(D) More than one of the above ❌
(E) None of the above ❌
Attempt Quiz Now:
BPSC Tre 4.0 DSA Practice Set