Questions tagged [huffman-code]

Huffman coding is a lossless compression algorithm that is optimal, assuming all input characters are drawn from a known discrete distribution.

Huffman coding is an algorithm that builds a variable-length, prefix-free code for each character in an alphabet based on the frequency of that character. The algorithm works by greedily assembling an encoding tree by combining together encoding trees for individual characters based on their weights. Low-weight trees are combined together until only a single tree remains.

Useful links

1053 questions
-2
votes
1 answer

Generate huffman tree on Nvidia GPU

Is there a way to recreate a huffman tree on the GPU using only the frequency and symbol? Also is it fast or even worth the trouble to do?
Eddi3
  • 59
  • 1
  • 8
-2
votes
1 answer

Traversing Huffman Tree in Java

I'm trying to use a recursive method to traverse a Huffman tree, and for each leaf node, add a Code record to an ArrayList. This is what I have so far. private void traverse(ArrayList code, BinaryTreeNode node, …
teej
  • 1
  • 1
-2
votes
2 answers

How do I create a sample text file with all 256 ASCII characters

I am writing a program for Huffman Coding. I need to feed in 10 files, each with 500-1000 characters containing all 256 ASCII characters atleast 1 time. How am I gonna do it? Are there sample files on the internet which contain all 256 ASCII…
Komal Rathi
  • 4,164
  • 13
  • 60
  • 98
-3
votes
1 answer

Getting "error C2039: 'value_type' : is not a member of 'std::greater<_Ty>'"

I have some troubles with the following code #include #include #include #include #include #include #include #include #include using namespace std; struct node { …
user466534
-3
votes
1 answer

How do I implement code to search word in a Trie?

Code: Search word in Trie Implement the function SearchWord for the Trie class. For a Trie, write the function for searching a word. Return true if the word is found successfully, otherwise return false. Note: main function is given for your…
-3
votes
1 answer

ConcurrentModificationException logic breakdown

As per docs ConcurrentModificationException states: ConcurrentModificationException occurs when an object is tried to be modified concurrently when it is not permissible. I'm trying to de-rust on some java conceptsand make a huffman compression…
-3
votes
1 answer

i can't decoding huffman using tree?

is there any problem with this code . i can't decode huffman with it. fault : segmentation fault (core dumped) char *real_bin = "100101111101001100" struct tree { int fre; char c; struct tree *left; struct tree *right; }; typedef struct…
-3
votes
1 answer

Reading Files Line by Line in C,

I've been working on creating a Huffman Table similar to below. What I'm trying to do Is I have some C code that does translate an array of letters and an array of their frequencies, I'm attempting to now read a file and convert the line numbers…
Rob
  • 403
  • 9
  • 19
-3
votes
1 answer

Encode a string of characters given a custom code table

I want to programmatically convert a string of characters stored in a file to a string of character codes (encode) by following a code table. The string of binary codes should then go to a file, from which I can revert it back to the string of…
Rabbani Rasha
  • 216
  • 3
  • 6
-3
votes
1 answer

How to decompress a string in huffman coding?

I compressed the "abc" word into "01100111" using haffman coding algorithm . I built the tree . According to tree a=01, b=100 , c=111 . how to decompress this word ?
-3
votes
2 answers

Converting JPEG to binary (1 and 0) format

I want to convert a JPEG file into its binary equivalent and then convert it back to its JPEG form. i.e Convert a JPEG file into 1's and 0's and output this into a text file and then take this text file and convert it back to the original image…
Meet
  • 35
  • 1
  • 2
  • 3
-4
votes
2 answers

C++ Huffman code implementation encoding right most of the time?

Evening all working on a C++ implementation of huffman coding, Here s what I have. Which oddly is working most of the time. But with certain input I am getting incorrect coding/output. Please let me know if you see what im missing here...Ill keep…
-4
votes
1 answer

Iterative solution for huffman coding

How would you iteratively build a huffman code? All solutions I have seen are recursive. I was curious if an iterative solution was possible.
-4
votes
1 answer

R5RS Scheme, Huffman tree function

The goal was to create a huffman tree (google if you do not know what it is) whose output does not contain the weight of the value, just the values located in leaves held by the placeholder "internal" with. I have created a working function that…
MitchG
  • 1
-4
votes
1 answer

C Segmentation fault (core dumped)

Hey i am starting to work on Huffman coding and I have a bit of a problem I getting this error Segmentation fault (core dumped) I understand it is caused by trying to reach memory you are not allow to but I can not realize what is the problem in…
Raz
  • 1
  • 2
1 2 3
70
71