Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1AAAAAAAA → 8A | AThe encoded string has 12 characters, which is longer than the original 6. RLE only saves space when there are long runs. | |
| 2ABCDEF → 1A1B1C1D1E1F | BAABBCC (6) → 2A2B2C (6) | |
| 3Comparing lengths shows whether RLE helped: the encoded text must be shorter than the original | CRLE counts consecutive repeats only. ABAB has no runs, so the correct encoding is 1A1B1A1B, which is twice as long. | |
| 4Choose a technique to suit the data: use RLE for data with long runs, such as a plain white image row | DBest case for RLE: one long run shrinks from 8 characters to 2 | |
| 5RLE always makes data smaller, so ABCDEF → 1A1B1C1D1E1F is shorter | EWorst case for RLE: no repeats, so the encoded data doubles from 6 to 12 characters | |
| 6ABAB → 2A2B (encoded is shorter, so RLE worked) | FWWWWWWWWWWWW → 12W |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
RLE expansion — When data has few repeats, run-length encoding adds a count to every character, so the result can be longer than the original. It only saves space when the data has long runs.ABC encodes to 1A1B1CIF encodedLen > originalLen THEN
OUTPUT "RLE made it bigger"
END IFAAAAAAAAAA -> 10A (3 chars)RLE saves space when data has long runsOriginal: ABCDEF, length 6
Encoded: 1A1B1C1D1E1F
Encoded length: 12