0% found this document useful (0 votes)
8 views1 page

Huffman Coding C Program Lab Guide

The document outlines a lab assignment for CS 39001 focused on implementing Huffman coding to assign variable length code words to characters based on their frequencies. It provides a specific set of characters and their frequencies, and requires the development of a C program to construct a Huffman tree. Additionally, the program should calculate and display the total number of bits needed to represent a file with 100,000 characters using the generated codewords.

Uploaded by

zeggbash.fl.1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Huffman Coding C Program Lab Guide

The document outlines a lab assignment for CS 39001 focused on implementing Huffman coding to assign variable length code words to characters based on their frequencies. It provides a specific set of characters and their frequencies, and requires the development of a C program to construct a Huffman tree. Additionally, the program should calculate and display the total number of bits needed to represent a file with 100,000 characters using the generated codewords.

Uploaded by

zeggbash.fl.1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like