Nony K

Nony K

  • NA
  • 29
  • 11.2k

LZ algorthims

Apr 17 2011 4:12 PM
Hi All,

My data set consist of numeric values 0s and 1s. I have designed a code that enables me to compress the string (rwo) to substring based on LZ algorthim. However, it seems that the substring is not correct as you can see in the following example:  

                  reading file -------------------> writing file 
Example 1.   100010000000000100--------->{1,0,001,0000,0000001,00} 
Example 2.   001001110010010000--------->{0,01,0011,10010,01000,0}

The correct answer should be like this see this but unfortunately i could not design it correctelly.  
 S = 010110011 ------------------------>substrings {0, 1, 01, 10, 011}, 
S= 001001------------------------------->substring {0,01,001}

Thank you very much in advance.   

Please see the attched code




Answers (16)