Question: Problem 6a rle.py : Run length compression [10 points] Write a function rle() that takes a list as input and returns another list with its

Problem 6a rle.py: Run length compression [10 points] Write a function rle() that takes a list as input and returns another list with its run length encoding. As always, the input list should not be modified in any way.

Problem 6b rle.py: Run length decompression [10 points] Write a function unrle() that takes the run length encoding as input and returns the original list. This is the inverse of the previous function (i.e., for anylistl,itsalwaystruethatunrle(rle(l)) == l).Onceagain,theinputlistshouldnotbemodifiedinany way.

Note: You can assume that all values in the encoding are immutable (i.e., you do not need to worry about making copies of the value component of each run).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!