5. Which type of tree guarantees better balance in the worst case, AVL trees or Red-Black trees?
6. Give the Huffman code that would be obtained for the following frequency data:
a. Blue - 45k occurrences
b. Red - 6k occurrences
c. Yellow - 7k occurrences
d. Green - 12k occurrences
e. Orange - 10k occurrences
f. Purple - 30k occurrences
7. Suppose we wanted a hash table to store data on 30 students in a lab section. We are considering two options:
a. One is to have 31 bins and to use the day of the month from their birthday (from 1-31).
b. The second is an algorithm that gives a perfectly even distribution using name data and is O(n) - where n is the length of the student's name.
Which option is better and why?