一棵树的高度是其中最长的根到叶路径的长度。高度为5的二叉树中的最大和最小节点数为
(A) 63和6
(B) 64和5
(C) 32和6
(D) 31和5答案: (A)
解释:
Number of nodes is maximum for a perfect binary tree.
A perfect binary tree of height h has 2h+1 - 1 nodes
Number of nodes is minimum for a skewed binary tree.
A perfect binary tree of height h has h+1 nodes.
这个问题的测验