Question: Someone designs a new greedy strategy that constructs the tree in a top down manner as follows, starting from a sorted list in decreasing order

Someone designs a new greedy strategy that constructs the tree in a "top down" manner as follows, starting from a sorted list in decreasing order of frequency:

  • If there is only one character, return that character as a single node tree.
  • Otherwise (recursively) return a tree whose left child is a leaf consisting of the first (highest frequency) character, and the right child is the tree built recursively from the rest of the list.

The height of the tree is

3

2

4

5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!