Today we are going to complete some exercises on Run Length Encoding (RLE)
Homework AJT
By next lesson RESEARCH and make a CAESER cipher.
Task 1
In your books or in your Google doc write a definition of RLE. Include the source
Task 2
Use the Run Length Encoding Calculator to encode these text strings.
|
|
Text string
|
Answer
|
AAAABBBBBBBBBCADDDDEEFFFFFFFF
|
|
ABCABCABCABCABCABCABCABCABCS
|
|
BBGGYYAACCFFEEBBGGYYAACCFFEE
|
|
Which
one compresses the most?
|
|
Why is
this?
|
|
Describe
in English the process the RLE calculator follows to encode a piece of text.
|
Task 3
An RLE
compression algorithm works by removing repeated data and replacing it with a
number representing the run length of that item.
·
Fill in the gaps to complete this
algorithm.
1. Start
with the first character in the string.
2. Write
down the number 1.
3.
Compare the first character with the next character on the right.
4. If
they are the same, ___________________________________.
5. If
they are not the same, ________________________________.
6. Move
on to the next character on the right.
7. Go
back to step 2 and repeat until you reach the end of the string.
8. _____________________________________________________.
Task 4
Test out the algorithm using these data strings:
o
AAAABBBBBBBBBCADDDDEEFFFFFFFF
o
ABCABCABCABCABCABCABCABCABCS
o
BBGGYYAACCFFEEBBGGYYAACCFFEE
No comments:
Post a Comment