Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lab 6: Implementing Huffman Codes and Heaps for Text Compression - Prof. Olac Fuentes, Lab Reports of Data Structures and Algorithms

Lab 6 for cs2402 spring 2009 course, focusing on huffman codes and heap implementation for text compression. Students are required to write a program that computes character frequencies from a text file, builds an optimal compressing tree using huffman's algorithm and a heap, compresses and decompresses the text using the generated codes, and tests the methods using the same text files from previous labs. Java built-in implementations are not allowed.

Typology: Lab Reports

Pre 2010

Uploaded on 08/19/2009

koofers-user-x26
koofers-user-x26 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download Lab 6: Implementing Huffman Codes and Heaps for Text Compression - Prof. Olac Fuentes and more Lab Reports Data Structures and Algorithms in PDF only on Docsity! 1 CS2402 Spring 2009 Lab 6 Huffman Codes and Heaps Due Friday, April 3, 2009 Instructions Write a program that implements Huffman codes to compress text. 1. Use a large text file to compute the frequency of each character. 2. Apply Huffman’s algorithm to build the optimal compressing tree. In order to find the trees with minimum weight efficiently, use a heap (with the modification that the root now will contain the smallest element). 3. Compress and the text using your codes. 4. Use your codes to decompress the text, making sure that you obtain the same text you provided as input. You are NOT allowed to use the Java built-in implementations of heaps or Huffman codes. Test your methods using the same text files you used for labs 4 and 5.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved