Question: [ 1 point ] Huffman::ascii _ decompress _ body ( ) : This function should read one bit ( a ' 0 ' or '
pointHuffman::asciidecompressbody: This function should read one "bit" a or char at a time from the input stream until a legal code is assembled, then write the corresponding decoded character to the output stream, and repeat until reaching the end of file
pointsHuffman::buildoptimaltrie: This function should create a forest of onenode tries akatriepq representing the characters in the input file and their frequencies, then repeatedly combine the two smallest tries until only one is left according to the following instructions:
Remove trie intriepqwith SMALLEST frequency, assign tofirst remove trie in PQ with NEXT SMALLEST frequency, assign tosecond Create newTrieNodeand makefirstandsecondits left and right children, respectively. Set new node's frequency to the sum offirstandseconds frequencies, and then put the whole thing back into the priority queue
pointsHuffman::computeallcodesfromtrie: The function should recursively traverse the trie rooted atTto determine thehuffcodestring at every leaf and initializecompressionmapanddecompressionmapwith this information
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
