Question: java question Data compression One obvious way to compress binary data is to count the 0s and 1s, and to represent sequences of one digit
java question

Data compression One obvious way to compress binary data is to count the 0s and 1s, and to represent sequences of one digit as a single number. Thus a String sequence like "001001 11" would be compressed to "2, 1, 2, 33". The first number in the compressed sequence is always the number of initial 0s, so a sequence like "1101111" would be compressed to "0, 2, 1, 4" Write the method compress that takes a String s containing only 0s and 1s, and returns a compressed version of s.//returns a compressed version of s public static String compress (String s) Write the method uncompress that takes a String s containing only digits, and//returns an uncompressed version of s.//returns an uncompressed version of s public static String uncompress (String s) Use this space and the following page for your answer to this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
