Data compression is a process that reduces the volume of files. The most important methods are lossless and lossy. The difference between these methods are in lossless comperssion method you don't lose any data but in lossy you may loss part of your data. The algorithm of lossless method is imagine we have a note, and in this the "tomorrow" word is repeated ten times, so we make a table with two columns, one column is for the real word and a column for the symbol word. now we put the word "tomorrow" in first column(real word) and put the symbol "F$3" in the second column (symbol) right beside the word "tomorrow" and in the note we put the symbol "f$3" where ever we saw the word "tomorrow".