Question: import java.util.Comparator; import java.util.ArrayList; import java.io . IOException; import java.util.Scanner; import java.io . FileReader; public class HuffmanCodeGenerator { / * * * Generates a table
import java.util.Comparator;
import java.util.ArrayList;
import java.ioIOException;
import java.util.Scanner;
import java.ioFileReader;
public class HuffmanCodeGenerator
Generates a table with a list of codewords
@param codeList the list of codes
@return an array list sorted by symbols in ascending order
public static ArrayList genTableArrayList codeList throws PQueueException
Implement this method
return null;
Generates Huffman codes given the root of a Huffman Tree
@param root the root of a Huffman Tree
@return an ArrayList containing SymData objects
public static ArrayList genHuffCodesSymData root throws PQueueException
Implement this method
return null;
Generates a binary Huffman Tree
@param huffForest a forest of SymData objects
@return a reference to the root of the Huffman tree
public static SymData genHuffTreePQueue huffForest throws PQueueException
Implement this method
return null;
public static void mainString args throws IOException
try
String usage "HuffmanCodeGenerator n;
usage "The data file name is entered as a command line argumet.n;
usage "The data file contains two columns per row.n;
usage "Each row has a symbol char and frequency pair.";
if argslength
System.out.printlnInvalid number of command line arguments";
System.out.printlnusage;
System.exit;
Complete the implementation of this method
catchPQueueException e
System.out.printlne;
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
