Skip to main content

Questions tagged [huffman-tree]

The tag has no usage guidance.

huffman-tree
3 votes
2 answers
119 views

Depth of a Huffman tree

I'm reading Algorithms by Jeff Erickson, and I have trouble in solving the exercise in Greedy Algorithms: (b) Suppose the total length N of the unencoded message is bounded by a polynomial in the ...
Z1qqurat's user avatar
1 vote
1 answer
58 views

Can't build huffman tree in C, qsort fails

I try to implement huffman code in C. I have two arrays, one storing all the nodes and one that contains pointers to certain nodes. The second one contains the unfinished trees that I want to combine. ...
TheGlibber's user avatar
0 votes
0 answers
7 views

Huffman Coding Error When Passing Parameter

code: typedef struct { int weight; char c; int parent, lchild, rchild; } Node, *HTree; void findmin(HTree ht, int len, int *p1, int *p2) void CreateHTree(HTree ht, int n) void print(...
Sparashy's user avatar
0 votes
0 answers
43 views

Huffman encyption coding program runs for too long

I have a c program that attempts implementing Huffman encryption. The problem is that the program runs indefinity after asking for the file containing the string to be encrypted is entered. i'm not ...
9_daytona's user avatar
0 votes
2 answers
217 views

Huffman coding rules and optimization

All sources i've read quote the below process to get Huffman codes: Arrange the elements in ascending order of their frequencies. Create a binary tree by repeatedly combining the two least frequent ...
Sam-Elie Eid's user avatar
1 vote
1 answer
64 views

How can one correctly extract Huffman Tree from a dynamic compressed block?

My problem is similar to the one solved HERE, with few differences. So the a Deflated block with dynamic Huffman codes is structured like this: |Block Header|compressed block|end of block| Then Block ...
terry franklin's user avatar
0 votes
1 answer
39 views

Is it possible match initial bytes of Deflate compressed data using knowledge of first portion of uncompressed data?

So my obsession with deflate compression is leading me no where but i feel like there is something i can do the process better. Here is what i understood so far: def lz77(uncompressed): #find ...
terry franklin's user avatar
0 votes
1 answer
50 views

How does a decompressor know the huffman tree that was used by the compressor?

From what i understood Deflate is LZ77 and Huffman encoding but i have been looking at the structure of .zip file but i haven't seen where to extract information about Huffman tree that was used in ...
terry franklin's user avatar
0 votes
1 answer
37 views

Index Out of Range error when Huffman Coding

I was trying to encode and decode an image using Huffman codes. I am encountering an issue when calling the methods from this class in the main method: using System; using System.Collections.Generic; ...
Catalanforyouforever's user avatar
0 votes
1 answer
34 views

Does the BRCI algorithm work for *all* Huffman Trees?

I'm trying to create a height-limited Huffman Tree. One algorithm proposed for this is the BRCI Algorithm, which promises a comparatively fast and simple to implement solution. This means that the ...
twynb's user avatar
  • 41
0 votes
1 answer
73 views

How to transfer a String data which starts with "0" to a byte type , and recover it without losing the "0" at the first place?

I was learning Huffman tree and code in Java recently. There is a serious problem when I am trying to encode the String binary. I will explain step by step. 1, These are the original words that I'm ...
Nicholas's user avatar
0 votes
0 answers
57 views

My program writes a string when its supposed to write bytes

I need to use Huffman encoding to compress, it should work properly showing a lot of 1s and 0s which is what it's supposed to return. Instead it returns this: "pbbuMWL62ue+z5RIEFoC", I have ...
Theonlybitarray's user avatar
2 votes
1 answer
124 views

I don't understand how to draw Huffman coding tree

If I'm correct, Huffman Tree is made with two minimum frequencies and keeps going. For example, letters A,B,C,D,E,F has frequencies of 15, 40, 60, 10, 30, 45 (200 total). first, D would go left and A ...
MKG MNK5168's user avatar
0 votes
1 answer
394 views

How to count the bits in a Huffman tree

I am looking at the below Huffman tree, the corresponding frequency table and the subtotal table. That table calculates the subtotal bits. I want to know how to count the subtotal bits. In the first ...
Cao Dingjie's user avatar
0 votes
1 answer
61 views

How to sort a heterogeneous list of Tree Objects and Tuples

How would I sort a list of tuple and tree objects? I have list of tuples (key: str, value: frequency), and huffman tree objects where the tree has a left, right, symbol and weight attributes, I would ...
Yusuf Gökçe's user avatar

15 30 50 per page