Dale - Computer Science Illuminated 95

Dale - Computer Science Illuminated 95 - 68 Chapter 3 Data...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Run-length encoding Replacing a long series of a repeated character with a count of the repe- tition 68 Chapter 3 Data Representation (because they appear in many different words). A disadvantage, as before, is that they are generally short patterns and the replacement savings per word is small. Run-Length Encoding In some situations, a single character may be repeated over and over again in a long sequence. This type of repetition doesn’t generally take place in English text, but often occurs in large data streams, such as DNA sequences. A text compression technique called run-length encoding capi- talizes on these situations. Run-length encoding is sometimes called recur- rence coding . In run-length encoding, a sequence of repeated characters is replaced by a flag character , followed by the repeated character, followed by a single digit that indicates how many times the character is repeated. For example, consider the following string of seven repeated ‘A’ characters: AAAAAAA
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online