file-compressor
所属分类:压缩解压
开发工具:Java
文件大小:0KB
下载次数:0
上传日期:2023-10-02 05:18:58
上 传 者:
sh-1993
说明: 文件压缩器,,
(file compressor,,)
文件列表:
.DS_Store (6148, 2023-10-01)
BinaryIn.class (4796, 2023-10-01)
BinaryIn.java (12984, 2023-10-01)
BinaryOut.class (4473, 2023-10-01)
BinaryOut.java (11075, 2023-10-01)
Huffman.class (189, 2023-10-01)
Huffman.java (1654, 2023-10-01)
HuffmanSubmit$Node.class (954, 2023-10-01)
HuffmanSubmit.class (5545, 2023-10-01)
HuffmanSubmit.java (6604, 2023-10-01)
alice30.txt (148544, 2023-10-01)
freq.txt (3585, 2023-10-01)
ur.enc (14018, 2023-10-01)
ur.jpg (14068, 2023-10-01)
ur_dec.jpg (14068, 2023-10-01)
# CSC-172 Project 2 - *Huffman Coding*
Submitted by: **Jassem Toumi && Hesham Elshafey **
Emails:
Author 1: **jtoumi@u.rochester.edu**
Author 2: **Helshafe@u.rochester.edu**
Description: **This code provides a Java implementation of the Huffman coding algorithm for compressing and decompressing files. The Huffman algorithm uses variable-length code words to represent characters in a file based on their frequency of occurrence. Huffman coding assigns shorter codes to more frequently used characters and longer codes to less frequently used characters.**
## Required Features
The following **required** functionalities/Methods are completed:
+------- Encoding (Developed by Jassem Toumi):
1. Read the file and store the frequency of each character
2. Build the huffman tree (using the frequency map) : implement a priority queue & min heap
3. Traverse huffman tree and build a code map : pairs (character , huffman-code)
4. Read the file again and write the encoded file ; replace each character with its huffman code
5. Write the frequency file: pairs (8-bit representaion of each char : frequency)
+------- Decoding (Developed by Hesham Elshafey)
1. Read the frequency file and create a map that stores pairs (character (from code) : frequnecy)
2. Build a huffman tree from the map your created in step 1
3. Read the encoded file (input file) and for each bit we traverse the tree(if false
we move left & vice versa) until the current node has no children then we write the corresponding character
4. Keep repeating step 3 until we decode the entire encoded file
近期下载者:
相关文件:
收藏者: