I am trying to implement the Huffman algorithm,
The problem that I am facing is that while decompressing I get almost
95% of the file correct,but it fills up some of the junk characters in between
the output file at different places.Also I do not see any regular pattern for
the places and the characters that are filled up in the file,when i tried this on
various files.
but it does work perfectly for smaller files,say upto 1KB files,the problem increases with
larger files.
I understand that there is no point sending the whole code(which is quite lengthy)
A general idea abt the data structures used...
--A 2-d array and a linked list initially contains the character with their respective frequencies.
--This linked list is then converted to a binary tree,based on the frequency of the characters.
--A struct which contains the 1/0 traversed code of the character,along with the character.
Using this struct the compressed file is produced,with bits packed into a byte.
Can u tell me why that could be happening ?
Also can u suggest me a way of debugging the code,so that I can know where the exact problem lies,
as it is not possible to use Trace i.e F7 for larger files.
Tell me if u need more information on this.
I am using TurboC 3.0 compiler.
Thanking You,
Rohit.