Skip to main content

Questions tagged [huffman-encoding]

0votes
1answer
296views

Binary Tree and Variable Length Codes for given Alphabets using Huffman Encoding (Confusion)

Last week our teacher gave us a question about Huffman Encoding Algorithm described as below. HUFFMAN ENCODING ALGORITHM: Consider all pairs: . Choose the two lowest frequencies, and make them ...
Khubaib Khawar's user avatar
5votes
2answers
556views

finding optimal token definitions for compression

I have a collection of strings which have a lot of common substrings, and I'm trying to find a good way to define tokens to compress them. For instance, if my strings are: s1 = "String" s2 = "Bool" ...
ErikR's user avatar
1vote
0answers
2kviews

Calculating uncompressed file size without uncompressing file in zlib

I am writing a python program which parses zip (currently only zlib, using DEFLATE compression) files and verifies the correctness of their headers and data. One of the things I'm trying to achieve is ...
S B's user avatar
  • 11
2votes
4answers
9kviews

Reconstructing a huffman tree using minimal information in the header

I'm writing a huffman encoding program in C. I'm trying to include the least amount of information in the header as possible, I know the simplest way to decompress the file in the header would be to ...
shoham's user avatar
1vote
0answers
171views

Encode Optimal Huffman code

I have given message encoded with non-optimal Huffman code. I need to decode the message and encode it again, but this time with optimal Huffman code, so after that I can find ...
Jovan Meshkov's user avatar
2votes
2answers
33kviews

How do I find average bits per symbol using huffman code?

I'm trying to write a program in c for Huffman coding, but I am stuck. For input I have: Sample input: 4 // here I scan how many letters I have A 00 // and for everyone I scan how they are ...
Maria's user avatar
0votes
0answers
107views

how to find average bits per symbol using huffman code? [duplicate]

I'm trying to write a program in c for Huffman coding, but i stack.In input i have: Sample input: 4 //here i scan how many letters i have A 00 // and for everyone i scan how they are coded in ...
Maria's user avatar
1vote
1answer
2kviews

How should I compress a file with multiple bytes that are the same with Huffman coding?

On my great quest for compressing/decompressing files with a Java implementation of Huffman coding (http://en.wikipedia.org/wiki/Huffman_coding) for a school assignment, I am now at the point of ...
Saturn's user avatar
  • 3,937
8votes
5answers
18kviews

How to discriminate from two nodes with identical frequencies in a Huffman's tree?

Still on my quest to compress/decompress files with a Java implementation of Huffman's coding (http://en.wikipedia.org/wiki/Huffman_coding) for a school assignment. From the Wikipedia page, I quote: ...
Saturn's user avatar
  • 3,937
2votes
1answer
2kviews

Does it matter the direction of a Huffman's tree child node?

So, I'm on my quest about creating a Java implementation of Huffman's algorithm for compressing/decompressing files (as you might know, ever since Why create a Huffman tree per character instead of a ...
Saturn's user avatar
  • 3,937
2votes
1answer
580views

Why create a Huffman tree per character instead of a Node?

For a school assignment we're supposed to make a Java implementation of a compressor/decompresser using Huffman's algorithm. I've been reading a bit about it, specially this C++ tutorial: http://www....
Saturn's user avatar
  • 3,937

close