# print - Problem A1 Consider the following table of...

This preview shows pages 1–4. Sign up to view the full content.

Problem A1 Consider the following table of frequencies of some English letters. C .028 E .127 F .022 N .067 R .061 U .027 Q .001 Y .020 1. Draw a Huﬀman trie for these letters and frequencies. Solution 0.128 0.098 0.127 0.067 0.061 0.055 0.043 0.027 0.028 0.021 0.022 0.020 0.001 NR QY FUC E 0.225 0.353 2. Give the Huﬀman encoding of each of these letters as given by the trie of part 1 in the table below. 3. Calculate the Huﬀman encoding of the following word: FREQUENCY Solution Minus the dots: 1001.01.11.10000.1010.11.00.1011.10001 Letter encodings: C 1011 E 11 F 1001 N 00 R 01 U 1010 Q 10000 Y 10001 CS 16 — Introduction to Algorithms and Data Structures Semester II, 99–00

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Problem A2 Show the execution of Dijkstra’s shortest path algorithm on the following graph, starting from vertex A . Draw the graph and show the length of the best paths found so far for each vertex after each relaxation step. AB CDE FG H I 3 10 2 8 4 6 1 13 6 2 6 20 Next Tentative Distance from Start Vertex Edge Connecting Vertex B C D E F G H I Next Vertex to Cloud A 13 6 4 D 10 5 4 7 24 A-D C 10 5 4 7 24 13 D-C F 10 5 4 7 24 13 9 D-F I 10 5 4 7 24 13 9 F-I B 10 5 4 12 7 24 13 9 D-B E 10 5 4 12 7 18 13 9 B-E H 10 5 4 12 7 18 13 9 C-H G 10 5 4 12 7 18 13 9 E-G 2
Problem A3 Consider the following ﬂow network: st AB CD 7 2 4 3 4 6 5 3 Execute the Ford & Fulkerson maximum ﬂow algorithm on this network.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

print - Problem A1 Consider the following table of...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online