This project implements a text compression algorithm using Huffman coding. Huffman coding is a popular method for lossless data compression, which assigns variable-length codes to input characters, with shorter codes assigned to more frequent characters.
- Compress text files using Huffman coding
- Decompress the compressed files back to their original form
- Efficient encoding and decoding processes
- Programming Language: C++
- Compiler: g++
- Version Control: Git
-
Clone the repository: bash git clone https://github.com/mihir2004/TextComp.git cd Text_compressor
-
Ensure you have a C++ compiler installed. For example, you can install g++ if it's not already installed: bash sudo apt-get install g++
-
Compile the project: bash g++ project.cpp -o text_compressor
- project.cpp: The main C++ source file containing the implementation of the compressor and decompressor.
- input.txt: Sample input text file.
- output.txt: Sample output file after compression or decompression.
-
Compress a file: bash ./text_compressor input.txt output.txt
-
Decompress a file: bash ./text_compressor -d output.txt decompressed.txt
- Fork the repository.
- Create a new branch (git checkout -b feature-branch).
- Commit your changes (git commit -am 'Add new feature').
- Push to the branch (git push origin feature-branch).
- Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.