Binary digits compression

186 Views Asked by At

I need to build a large program as a project for school and I've been thinking about a file compression like winzip/winrar. I read about types of algorithms and their examples but the problem is that all the examples are presenting the implementation on alphabetic strings and it's not helping me because file is not a string, it consists of a succession of zeros and ones. For example, if I have a file - " 0111000110111001 " how can I compress it?

1

There are 1 best solutions below

7
AudioBubble On

Even if the examples that you've seen use alphabetic strings, at machine level, it's still a succession of 0 and 1. If you want to apply those examples to your binary file, you can read it byte by byte, or word by word. By this way, what you've seen for alphabetic strings will still be available.