Algorithms Flashcards

1
Q

What is Run-length encoding (RLE)?

A

form of lossless data compression in which runs of data (sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How would the following line be rendered when using RLE?

XXBBBBBWWWWWWA

A

2X5B6WA - better for shorter strings

XXBB5WW6A - better for longer, more runs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly