Learning Objectives for Exs. 5.1-5.5: The student shall be ableto write a generic binary tree class and shall be able to explainthe characteristics of binary trees.
5.1 Consider this binary tree.(a) List the descendants of node 8.(b) List the ancestors of 1. (c)List the leaf nodes. (d) List the internalnodes.
4 5 Show transcribed image text 4 5
Answer
(a) List the descendants of node 8.5, 6, 2, 9 (b) List the ancestors of 1.3, 7 (c) List the leaf nodes.5, 9, 1, 4 (d) List the internal nodes.7, 8, 3, 6, 2,