In: Advanced Math
20. The concept of best-, worst-, and average-case analyses extends
beyond algorithms to other counting problems in mathematics. Recall
that the height of a binary tree is the number of edges in the
longest path from the root to a leaf.
(a) Find the best-case height of a binary tree with five
nodes.
(b) Find the worst-case height of a binary tree with five
nodes.
(c) Find the average-case height of a binary tree with five nodes.
For this problem, you will have to list all possible binary trees
with five nodes. Assume that each of these is equally likely to
occur.
(d) Find the worst-case height of a binary tree with n nodes. (e)
Approximate the best-case height of a binary tree with n
nodes.