2c03-review - 00070

# 2c03-review - 00070 - 15[10] Consider the ADT MFSET. Let S...

This preview shows page 1. Sign up to view the full content.

13 Now, we suppose prob(a) > prob(b), which means a is not used before b is used in construction of Huffman tree. These imply that prob(a) > prob(T), because prob(b) and prob(T) must be the smallest two ones. With the same reason, prob(c) > prob(b), pro(T), otherwise, c will be used before y is formed and cannot be combined with a. Therefore, prob(x) = prob(a) + prob(c) > prob(b) + prob(T) = prob(y), which is a contradiction to induction hypothesis. Less detailed proofs are also OK. 14[21]. a[7], b[7], c[7], solutions at the end.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 15[10] Consider the ADT MFSET. Let S 1 = {1}, S 2 = {2}, S 3 = {3}, S 4 = {4}, S 5 = {5}, S 6 = {6}. What is the tree that results if we perform the following sequence of operations: MERGE(S 2 ,S 5 ) MERGE(S 1 ,S 3 ) MERGE(S 2 ,S 1 ) MERGE(S 4 ,S 6 ) MERGE(S 2 ,S 4 ) FIND(5) Assume that we always merge the smaller set into the larger one and if two sets are of equal size, merge the second into the first. Also assume that path compression is used. S 2 2 5 1 4 3 6...
View Full Document

## This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.

Ask a homework question - tutors are online