
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Assigned On: January 31, 2006 Due On: February 7, 2006
Instructions: Solve these problems in groups of size at most 3. Solution to each problem must be on a separate sheet; this assists us greatly in grading the problems.
Recommended Reading: Chapter 4 of the textbook and lecture notes on the web.
Problem 1 Solve problem 4.26 from the class textbook.
Problem 2 Consider a data structure for Union-Find that performs path compression in find as discussed in class. Starting from makeUnionFind(S), show that any sequence of m union and find operations, where all the union operations appear before any of the find operations, takes O(m) time.
Problem 3 As observed in section 4.8 of the textbook, there are situations where we would like to modify the code for an alphabet, and communicate the new code over a channel. This problem is about how one can represent a Huffman Code as a bit string.
Assume that the alphabet is S = { 0 , 1 , 2 ,... n โ 1 }. Show that the optimal prefix code for alphabet S can be represented using 2n โ 1 + nโlog nโ bits. Note: It is possible that a symbol in S is encoded using O(n) bits in the optimal prefix code. (Can you think of an example?) So just sending the code of each symbol will not be efficient.