There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code. Flon's Law

Run-length encoding

Language Java | Level Intermediate | Category Data structure | September 9, 2015 10:12 am


Data structure Description

Run-length encoding is a very simple form of data compression in which runs of data are stored as a single data value and count, rather than as the original run. Write a program to implement Run-length encoding for string


Output

   					 

Run Length Encoding Text: WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
Encoded Text: 12W1B12W3B24W1B14W
Decoded Text: WBWBWBWBWBWBWB

				    

Comments


No comments available!

Please login to add comments.