Professional Documents
Culture Documents
Assignment 2.4
Assignment 2.4
Practical exercises
Question 1. Write Java programs to perform the tasks related with Huffman coding algorithm as
follows:
1. Given a set of characters with frequencies (or probabilities), create the Huffman code binary
tree.
2. Calculate frequencies of all characters contained in the text file and create the Huffman code
binary tree for all characters contained in the text file.
3. Given a Huffman code tree. Print codewords of all leaf nodes.
Question 2. Write Java programs to implement the string matching by brute force and KMP.