2 ms·
It's simple enough to explain in a page of pseudocode More like a paragraph... https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch#Encoding https://
by userbinator 7y ago
It's simple enough to explain in a page of pseudocode
More like a paragraph... https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch#Encoding https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Wel...
Personally, I like LZ more than LZW because it doesn't have to slowly "build up" the dictionary in the same way as LZW nor need bit-I/O (because you can have an 8, 16, or 32-bit "indicator", followed by that many literal or length/distance pairs) and thus makes for an even simpler (and faster) algorithm. The only downside is that it's more asymmetric, in that compression is usually far slower than decompression (which can be faster than memcpy() - see http://www.oldskool.org/pc/lz4_8088 http://www.oldskool.org/pc/lz4_8088 ) because the former has to do a lot of searching while the latter is mainly copying memory.