This preview shows page 1. Sign up to view the full content.
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
This note was uploaded on 06/09/2011 for the course CS 11025 taught by Professor Nil during the Spring '11 term at National University of Singapore.
 Spring '11
 NIL
 Algorithms, Data Structures

Click to edit the document details