Algorithm Lab
(CS 39001)
Lab Week 6
Aim of the program
Huffman coding assigns variable length code words to fixed length input characters
based on their frequencies or probabilities of occurrence. Given a set of characters
along with their frequency of occurrences, write a C program to construct a
Huffman tree.
Given:
Alphabet a b c d e f
Frequency 45 13 12 16 9 5
(in 1000)
Output (to be shown on the console):
Alphabet a b c d e f
Codeword
BitSize
Based on the frequency given, print the total number of bits needed to represent a
file with 100,000 characters.