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
Loading
Sam HobbsPosted Apr 19, 2011, 9:01 PM
Nony KPosted Apr 19, 2011, 7:17 PM
I have attached the source code which i thought i did before but i did not aware that my code had not been upload. Please find the code attached.
Nony KPosted Apr 19, 2011, 7:15 PM
I have attached the source code which i thought i did before but i did not aware that my code had not been upload. Please find the code attached.
Sam HobbsPosted Apr 19, 2011, 4:25 PM
VulpesPosted Apr 19, 2011, 4:06 PM
Sam HobbsPosted Apr 19, 2011, 3:32 PM
Also as you, Vulpes, say we don't see the source code. I think Nony is not putting much effort into this.
Vulpes, there are a few articles in this web site showing use of DeflateStream, which uses the LZ algorithm.
VulpesPosted Apr 19, 2011, 6:25 AM
However, I'd check your implementation against this one (http://www.codeproject.com/KB/recipes/VB_LZW.aspx) which seems to work OK. It's in VB.Net rather than C# but shouldn't be difficult to translate.
Nony KPosted Apr 19, 2011, 5:53 AM
Thank you for your assistant.
Nony KPosted Apr 19, 2011, 5:52 AM
Thank you for your assistant.
Sam HobbsPosted Apr 18, 2011, 3:07 PM
Suthish NairPosted Apr 18, 2011, 2:50 PM
Nony KPosted Apr 18, 2011, 1:56 AM
The only problem that i have is on the outcome. The result of my algorthim is not correct 100010000000000100--------->{1,0,001,0000,0000001,00}
001001110010010000--------->{0,01,0011,10010,01000,0} . I need your advice on how can i change my code to get the correct LZ algorthim examples.
the correct LZ examples
S = 010110011 ------------------------>substrings {0, 1, 01, 10, 011},
S= 001001------------------------------->substring {0,01,001}
Sam HobbsPosted Apr 17, 2011, 11:04 PM
Nony KPosted Apr 17, 2011, 9:33 PM
Nony KPosted Apr 17, 2011, 9:33 PM
Sam HobbsPosted Apr 17, 2011, 9:22 PM