Exemplo n.º 1
0
 /**
  * create a Huffman Tree from a frequency table (which must be an Integer Array of exactly 255
  * elements)
  *
  * @param frequencyTable
  */
 public HuffmanTree(int[] frequencyTable) {
   build(frequencyTable);
 }
Exemplo n.º 2
0
 /**
  * create a Huffman Tree from a given source. Counts the frequency of each byte on the source and
  * constructs the tree accordingly
  *
  * @param source an arbitrary sequence of bytes.
  */
 public HuffmanTree(byte[] source) {
   build(constructTable(source));
 }