Our websites use cookies. By continuing, you agree to their use. See details
Huffman Compression | Portfolium
Huffman Compression
favorite 1
visibility 176
September 29, 2015 in Coding
1 / 3
I've written the code used to build a huffman compression tree and and set the huffman compression codes. To build the tree in java, a queue is used in order to retrieve and remove the two lowest frequency characters and combine them into one and reinsert it into the tree, using queue.poll and queue.add. In order the set the huffman codes, a loop simply traverses the tree and sets a 0 for left children and a 1 for right children. the output shown is the boolean codes for the sample input shown in the main method.
© 2025 • All content within this project is strictly the property of Adam Kutchak and is not for public use without permission. Report Abuse

Comments

Adam Kutchak

2 Skills

5 Tags

1 Likers

Danial Esmaeili