0. CS Project 5: Huffman Encoding
encoding
huffman
main
handles user requests to compress/decompress files.

uses an Encoding object to build the encoding and bstream objects to read/write

encode
from characters to bit pattern
Variables:
  • Encoding tree (as described in handout)
  • Map of char counts
  • decode
    from bit pattern to characters
    write file header
    containing the encoding table
    Included
    Classes:
    pqueue and bsteam (to read/write onto files)
    getCharCount
    takes in file, updates char count map in encdoing
    Create single trees
    one for each char, with weight = freq
    Compressing
    pluck smallest 2
    combine them
    Repeat above
    until only one tree left
       Login to remove ads X
    Feedback | How-To