compression definition code example Example: compression A compression algorithm seeks to reduce the amount of space a file takes up.