Question: C++ question on the function below that I am struggling to write. All help is appreciated. I have the code I have written so far

C++ question on the function below that I am struggling to write. All help is appreciated. I have the code I have written so far under the question which has a function named getFreq that takes a file with characters and updates an array of how many times each character is read in the file. Any method in completing the below function is allowed.

C++ question on the function below that I am struggling to write.

#include #include #include #include #include using namespace std;

bool die(const string & msg); void getFreq(unsigned long long freq[256], const string & fileName); int main() { unsigned long long freq[256];//array to store frequency char fname[100];//array to read a file name cout > fname; //filename from user getFreq(freq, fname);//call to the function } bool die(const string & msg) { cout

*/ //outputs frequencies for all characters in ascii table

cout Write function named huffman: void huffman(string code[256], const unsigned long long freq[256l); On entry, code is ug (unpredictable garbage). huffman's job is to set each string of code so that code represents an optimal Huffman code. (There's more than one correct code, because there's generally a tie for what's optimal.) For chars that don't appear in the file (so the freq element is 0), just set the corresponding string to the empty string:"" Write a main that passes file name to getFreq, passes the freq arry to huffiman, and outputs the Huffman code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!