A simple Java implementation of the Huffman Encoding Algorithm for text compression and decompression.
- Builds a Huffman Tree based on character frequencies
- Encodes a given string into a compressed binary format
- Decodes the binary back into the original message
- Uses
HashMap,PriorityQueueandrecursion
- Frequency map is built from the input string.
- A priority queue constructs the Huffman Tree.
- Encoding and decoding maps are generated.
- Input text is converted to a binary string using the encoder.
- The binary string is decoded using the decoder.
Encoded: 00011110 Decoded: Code
javac BitCompressor.java
java BitCompressor