Data Structures, Algorithms, & Applications in C++
Chapter 10, Exercise 45
Yes, the compressed file produced by LZW compression can be longer
than the original file. For example, consider a file with a single character.
Since every code produced by the LZW compressor is 12
bits long, the single character file gets replaced by a 2
character file (the twelve-bit code gets output as two bytes in this case).
The worst that can happen is that each character of the input file is replaced
by a twelve-bit code. So, if the input file is
n bytes/characters long, the ``compressed file'' is
at most ceil(1.5n) bytes long.