Click here to Skip to main content
15,905,913 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using the simple Huffman algorithm to compress and decompress a string. It takes less than a second to compress a 2mb file, but just under a minute to decompress. Is this normal, or is there a problem with my decompression logic? I can paste my code if this is not right!

EDIT: I just want to know from other peoples experience with using a Huffman algorithm if this is normal behaviour or if I have gone astray somewhere. The code doesnt break. If people say this is not normal, I can post my code and they can rip it a part and tell me what I have done wrong, otherwise, its just a waste of time.
Posted
Updated 5-Jun-11 21:57pm
v2
Comments
OriginalGriff 6-Jun-11 3:41am    
Post the relevant code fragment: it is next to impossible to work out without it!
OriginalGriff 6-Jun-11 4:22am    
At the moment, without seeing the code, the question is a waste of time!
DominicZA 6-Jun-11 4:34am    
All I want to know is under normal circumstances, how long does it take to decompress a file compressed with a Huffman algorithm? For the purpose of this question, lets assume the uncompressed file is 2mb. No code needed!
[no name] 9-Jun-11 12:33pm    
If compression takes one second than decompression shouldn't take one minute. Can't imagine that this is normal.
Does the file really decompress or is the result an invalid file?
Sergey Alexandrovich Kryukov 6-Jun-11 13:17pm    
It does needs code if your concern is speed.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900