Question: Write a function called compress(s) that takes a binary string s of length less than or equal to 64 as input and returns another binary
Write a function called compress(s) that takes a binary string s of length less than or equal to 64 as input and returns another binary string as output. The output binary string should be a run-length encoding of the input string. You may need a helper function or two — you may name these whatever you like.
Write a function called uncompress(c) that “inverts” or “undoes” the compressing in your compress function. That is, uncompress(compress(s)) should give back s.
Step by Step Solution
3.42 Rating (155 Votes )
There are 3 Steps involved in it
Lets start by explaining and implementing these functions stepbystep Function compresss The task here is to implement runlength encoding on a binary s... View full answer
Get step-by-step solutions from verified subject matter experts
