Then, using run length encoding, we can represent it as: A2C3B5A4F8 It is useful when we want to store or transmit large sequences of data.įor example if the sequence is : AACCCBBBBBAAAAFFFFFFFF
Using run length encoding, we can save memory space while transmitting data and preserving its original form. When a character occurs a large number of times consecutively in a sequence, then we can represent the same consecutive subsequence using only a single occurrence of that character and its count. Lossless data compression refers to compressing the data in such a way that the original form of the data can then be derived from it. Run length encoding is an algorithm for performing lossless data compression. What is the need of run length encoding?.