I'd suggest starting with LZ77: http://en.wikipedia.org/wiki/LZ78[^] - It is one of the earlier most widespread lossless algo. - It has been the base for many other algo. - The compress and decompress code can be done in less than 100 lines of code. It might take a while, but get a copy of the code and study it until you understand what every single line is doing. Then try to modify it and understand how all the parameters are inter-related.
...cmk The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying. - John Carmack