Similar questions 4 more →
Binary Search & Balanced Trees


Answer & solution
Answer: Root 15; left subtree 9(3(1,∅),12); right subtree 32(20(∅,25),∅). (no official key was published)
Step through it (19 steps)
Use the rule smaller keys go left and larger keys go right. Insert 15 as root; 32 right of 15; 20 left of 32; 9 left of 15; 3 left of 9; 25 right of 20; 12 right of 9; 1 left of 3.
15
/ \
9 32
/ \ /
3 12 20
/ \
1 25Accessible description: root 15 has children 9 and 32. Node 9 has children 3 and 12; node 3 has left child 1. Node 32 has left child 20, whose right child is 25. All other links are null. Inorder traversal 1,3,9,12,15,20,25,32 verifies the ordering.