Unformatted text preview: code, such that it could be easily implemented in a real programming language such as Java. Hint: An acyclic undirected graph can be seen as a tree. 3. (6 marks) A Fle contains only colons, spaces, newlines, commas, and digits in the following frequency: colon (100), space (605), newline (100), comma (705), 0 (431), 1 (242), 2 (176), 3 (59), 4 (185), 5 (250), 6 (174), 7 (199), 8 (205), 9 (217). Give an optimal Hu±man code. 4. (5 marks) Give the optimal binary search tree for the following words, where the probability of occurrence is in parentheses: “a” (0.18), “and” (0.19), “i” (0.23), “it” (0.21), “or” (0.19). 1...
View
Full Document
 Spring '11
 NIL
 Algorithms, Graph Theory, Data Structures, algorithm design techniques, acyclic undirected graph

Click to edit the document details