Binary Search & Balanced Trees



Answer & solution
Answer: Successor replacement yields root 20; predecessor replacement yields root 12. (no official key was published)
Choose inorder-successor replacement: the least key in the right subtree of 15 is 20. Copy 20 into the root and remove the old 20 node, reconnecting its right child 25 as the left child of 32.
20
/ \
9 32
/ \ /
3 12 25
/
1Accessible description: root 20 has children 9 and 32; 9 has children 3 and 12; 3 has left child 1; 32 has left child 25. Alternatively, inorder-predecessor replacement uses 12 as root and removes the old leaf 12. That result is 12(9(3(1,∅),∅),32(20(∅,25),∅)). Both are valid because the question does not prescribe which replacement policy to use.