Write a program to compress a file using a huffman code

Assignment Help Data Structure & Algorithms
Reference no: EM131794013

(Project) Write a program to compress a file using a Huffman code and to decompress a file generated using this code.

The program should first read through the file and determine the number of occurrences of each character in the file and the total number of characters in the file.

The weight of each character will be the frequency count for that character.

The program should then use these weights to construct the Huffman codes for the characters in the file.

It should then read the file again and encode it using these Huffman codes and generate a file containing this encoded data.

Compute the compression ratio, which is the number of bits in the compressed file divided by the total number of bits in the original file (eight times the number of characters in the file).

The program should also provide the option of decompressing a file that was encoded using this Huffman code.

Reference no: EM131794013

Questions Cloud

What is its times-interest-earned ratio : Graser Trucking has $17 billion in assets, and its tax rate is 30%. Its basic earning power (BEP) ratio is 15%, and its return on assets (ROA) is 3%.
Write a function that reads a table of letters : Write a function that reads a table of letters and their weights and constructs a Huffman code for these letters.
Calculate the earnings per share : The Hamilton Corporation has 2 million shares of stock outstanding and will report earnings of $6,700,000 in the current year.
Prepare all necessary journal entries for both situations : Journal Entries for Fair Value and Equity Methods Presented two independent situations. Prepare all necessary journal entries in 2010 for both situations
Write a program to compress a file using a huffman code : The program should first read through the file and determine the number of occurrences of each character in the file and the total number of characters.
What is the underlying legislation : The day after the handshake agreement, Jones receives and accepts another offer for $110,000 for the property.
Available for the certified project manager associate : Test vouchers are available for the Certified Project Manager Associate (CAPM) exam.
Explain the rules of debit and credit : Explain the rules of debit and credit. Give an example from a business transaction - You should use the APA guidelines for writing and citations
Design and test an axletree class template : Write a driver program to test your AVL Tree class template from Exercise.Design and test an Axletree class template.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd