Question: Let T be a full binary tree. Let v be a node in T , and define imbalance ( v ) to be the absolute
Let be a full binary tree. Let be a node in and define imbalance to be the
absolute difference between the number of leaves in the left subtree of and those in
its right subtree. If is a leaf, then imbalance
We extend the definition of imbalance to the entire tree as follows:
imbalance imbal ance
a points Find an upper bound for imbalance Provide an example of a full
binary tree whose imbalance is maximized.
b points Draw a full binary tree such that imbalance imbalance for
some node that is not the root of Explicitly indicate which node is and state
imbalance for your tree.
c points Describe, in pseudocode, an efficient algorithm to compute imbalance
Provide the running time of your algorithm and justify your analysis.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
