Question 26
What is the Inorder predecessor of 15 in the Binary Search Tree where node 15 has left child 6 (with left child 3 [children 2, 4], right child 7 [right child 13, left child 9]) and right child 18 (left 17, right 20)?
Step-by-Step Solution
Detailed Explanation:
The inorder predecessor of a node is the maximum value in its left subtree.
The left subtree of node 15 has root 6.
Moving to the rightmost node in the left subtree: 6 -> 7 -> 13 (which has left child 9).
The maximum node in node 15's left subtree is 13.