As CPallini said the Wikipedia article is a good place to start, you should also learn to use Google, the first few hits would give you the answers you are looking for. Anyway, read
this article[
^] for an explanation of the Deflate algorithm. There is some example code of the Deflate algorithm here[
^].