In our lecture notes, the first example we had: abbabb and we build our dictionary as: a:0 b:1 c:2 d:3 ab:4 bb:5 ba:6 bab:7
Seems to me that the "bab:7" is obtained by reading a word "ab" already in the dictionary.
But for the homework instruction of LVW compression, in the debugging section, the example Mike gave grabs only one character from the stream, not a word: 011010... Table: 01, 11, 10, 010... (notice we don't have 101 after 10)
Are these different algorithms? Since there are so many different versions of LZ compression, which one is the one we want to implement? |