Click or drag to resize
Huffman Class
The Huffman class provides methods for compressing and expanding a binary input using Huffman codes over the 8-bit extended ASCII alphabet.
Inheritance Hierarchy
SystemObject
  Algs4NetHuffman

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Huffman

The Huffman type exposes the following members.

Constructors
  NameDescription
Public methodHuffman
Uses file names to direct input and output
Top
Methods
  NameDescription
Public methodCompress
Reads a sequence of 8-bit bytes from standard input; compresses them using Huffman codes with an 8-bit alphabet; and writes the results to standard output.
Public methodExpand
Reads a sequence of bits that represents a Huffman-compressed message from standard input; expands them; and writes the results to standard output.
Public methodStatic memberMainTest
Sample client that calls Compress() if the command-line argument is "-" an Expand() if it is "+".
Top
Remarks

For additional documentation, see Section 5.5 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class Huffman implementation by the respective authors.

See Also