8. a. Draw a binary tree with 10 nodes labeled 0, 1, …, 9 in such a way that
the inorder and postorder traversals of the tree yield the following lists: 9,
3, 1, 0, 4, 2, 7, 6, 8, 5 (inorder) and 9, 1, 4, 0, 3, 6, 7, 5, 8, 2 (postorder).
9. The internal path length of an extended binary tree is defined as the
sum of the lengths of the paths–taken over all internal nodes–from the
10. Write a program for computing the internal path length of an extended
binary tree. Use it to investigate empirically the average number of key
comparisons for searching in a randomly generated binary search tree.
11. Chocolate bar puzzle Given an -by-chocolate bar, you need to break