Imagine you wrote a cool code where every time there were double letters, you replaced them with a number. Now lets say oo (two lower case Os) = 1, and ll (two lower-case Ls) = 2. Using that code:
balloon becomes ba21n: _balloon_ is 7 characters but _ba21n_ is only 5!
Now imagine that the pattern lloo happens alot, so you specify a special code for that. We’ll use 9 for that.
Now _balloon_ becomes _ba9n_ which is only four characters!
Of course it’s not that simple, but that’s compression in a nutshell. When you get longer strings of repetitive data (there are lots of zeros in files, for example) the compression gets even better.
Latest Answers