Lz77 compression algorithm c++ implementation