Question: A bitstring is just a sequence of bits, e . g . 1 0 0 1 0 1 1 0 . Normally, printable characters in

A bitstring is just a sequence of bits, e.g.10010110. Normally, printable characters in a file are encoded
as bytes, or bitstrings of length 8. This is called ASCII code. For example, the ASCII code for the character
a is the bitstring 01100001, which is 97 in binary.
However, we are not forced to use a fixed-length encoding. If we choose a di
erent encoding in which the codes can have di
erent lengths, then we can assign shorter strings to the more frequent characters, thereby saving space.
To illustrate, lets do this for bitstrings of length 2. Suppose we have a file that is exactly 2000 bits long,
so it can be viewed as a sequence of 10002-bit bitstrings. Suppose we scan the file and find that the four
2-bit bitstrings 00,01,10,11 occur in the file with the frequencies as shown in Fig. 1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!