Question: Consider a perfectly balanced (also called simply perfect) binary tree, with all leafs being at the same depth from the root. Let the tree be
Consider a perfectly balanced (also called simply perfect) binary tree, with all leafs being at the same depth from the root. Let the tree be of height h.
a. Whats the number of nodes in this tree expressed as a function of h? (2 pts)
b. Whats the number of leaf nodes in such a tree? (2 pts)
c. Whats the number of internal (non-leaf) nodes? Can you comment on the relative number of leaf and non-leaf nodes? (2 pts)
d. If the tree has n nodes, for which n is it possible to arrange the nodes into a perfect binary tree? (2 pts)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
