Question: Heap algorithm input: aaaa bbc aaaa bbc d eee eee eee fff ggg 1 Huffman Codes: Due October 16, 2018 A Huffman code can be
Heap algorithm
input:
aaaa bbc aaaa bbc d eee eee eee fff ggg


1 Huffman Codes: Due October 16, 2018 A Huffman code can be used to compress a file. It replaces fixed-size, one-byte characters by variable- length codes (strings of bits). The codes for the most frequently used characters will be shorter than S bits, those for unusual characters will be longer. No codes are generated for characters that are not used. The input file is read twice, once to generate the code, then again to encode the file. This is an effective compression method for all ASCII text files, because the ASCII code uses only 7bis and the Huffman Code uses all 8 bits in a byte Coding this multi-step algorithm will be your work for the next month. In the process, you will use several major data structures and produce a bit-oriented output file. The UML diagram below shows the overall architecture of the completed project. The green and yellow parts will be created in Program 5. main Huftman (Controller) HuttHep hp dstreamplaintext HutCode hc BOFstream compressed trng 2 Goals of Program 5 1. To use a command-line argument for main(), the name of the file to be compressed. 2. To write the first two phases of a file compression program that we be further developed in programs 6 and 7 3. To use characters as subscripts for an array To implement/adapt the heap algorithms. 2.1 The main Program The main progra. In main0 1. Call banner) 2 Then pick up the name of the input file from the command line. Call the Huffman constructor with this file name as its parameter 3. Call Huffman: compress) Cl byeand end execution 2.2 P5 Phase 1: The Initial Tally In this phase, you will count the number of times each character appears in a text file. Debug this before you start Phase 2 1 Huffman Codes: Due October 16, 2018 A Huffman code can be used to compress a file. It replaces fixed-size, one-byte characters by variable- length codes (strings of bits). The codes for the most frequently used characters will be shorter than S bits, those for unusual characters will be longer. No codes are generated for characters that are not used. The input file is read twice, once to generate the code, then again to encode the file. This is an effective compression method for all ASCII text files, because the ASCII code uses only 7bis and the Huffman Code uses all 8 bits in a byte Coding this multi-step algorithm will be your work for the next month. In the process, you will use several major data structures and produce a bit-oriented output file. The UML diagram below shows the overall architecture of the completed project. The green and yellow parts will be created in Program 5. main Huftman (Controller) HuttHep hp dstreamplaintext HutCode hc BOFstream compressed trng 2 Goals of Program 5 1. To use a command-line argument for main(), the name of the file to be compressed. 2. To write the first two phases of a file compression program that we be further developed in programs 6 and 7 3. To use characters as subscripts for an array To implement/adapt the heap algorithms. 2.1 The main Program The main progra. In main0 1. Call banner) 2 Then pick up the name of the input file from the command line. Call the Huffman constructor with this file name as its parameter 3. Call Huffman: compress) Cl byeand end execution 2.2 P5 Phase 1: The Initial Tally In this phase, you will count the number of times each character appears in a text file. Debug this before you start Phase 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
