9 Trees
9 Trees
Solution:
(i) The parent of c is b. The children of g are h, i, and j.
The siblings of h are i and j. The ancestors of e are c,
b, and a. The descendants of b are c, d, and e.
(ii) The internal vertices are a, b, c, g, h, and j. The
leaves are d, e, f, i, k, l, and m.
(iii) We display the subtree rooted at g.
Example: Are the following rooted trees full m-ary trees for some
positive integer m?
The preorder traversal begins by visiting r, and continues by traversing T1 in preorder, then
T2 in preorder, and so on, until Tn is traversed in preorder.