Tree Properties & Traversals

Answer & solution
Answer: Parents: 1:none; 2:1; 3:2; 4:2; 5:4; 6:1; 7:6; 8:6; 9:1; 10:9; 11:9; 12:9. (no official key was published)
1. The final postorder entry 1 is the root. The next preorder value 2 starts its first child subtree; that subtree ends at 2 in postorder, so it contains {2,3,4,5}.
2. Within subtree 2, node 3 is first and is already a complete subtree. The next child 4 has postorder 5,4 and therefore child 5.
3. The next unused preorder node is 6. Its postorder block is 7,8,6, giving children 7 and 8.
4. The remaining child subtree of 1 is rooted at 9 and has leaves 10,11,12.
5. These are ordered children according to the given traversals. A general rooted tree is intended, not a binary-tree constraint.
Diagram / structural description
1 ├─2 │ ├─3 │ └─4 │ └─5 ├─6 │ ├─7 │ └─8 └─9 ├─10 ├─11 └─12