Overview
Run-Length Encoding replaces stretches such as AAAA with a compact count and value pair. It is simple and effective when long repeated runs are common.
Compresses repeated consecutive values by storing each value with its run length.
Compact metadata for implementation and discovery.
Run-Length Encoding replaces stretches such as AAAA with a compact count and value pair. It is simple and effective when long repeated runs are common.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n)
Worst
O(n)
Space
O(n)
run = (symbol, count)Stores one repeated stretch as the value and the number of times it appears.
Show repeated blocks collapsing into count labels.
RLE is often combined with other transforms that create longer runs.
What each reference supports for this entry.
Data compression textbook reference for the coding or dictionary method used by Run-Length Encoding.
Good next jumps from the relationship graph, ranked for useful discovery.
BWT can create runs that make run-length encoding more effective.
RLE exploits repeated runs while Huffman coding exploits symbol frequencies.