For plain text a Lempel-Ziv (LZ) approach is better than a Run Length Encoding (RLE).
In normal text you rarely have concecutive characters, but really often repeating segments. This is where LZ shines.
RLE is easier and cheaper to implement, as you don't need to keep a dictionary around. So less memory needed.
True that ! this question is meant for testing string manipulation skills and not to test compression algorithm skills.
I shall look into LZ approach though ! thanks for the info!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For plain text a Lempel-Ziv (LZ) approach is better than a Run Length Encoding (RLE).
In normal text you rarely have concecutive characters, but really often repeating segments. This is where LZ shines.
RLE is easier and cheaper to implement, as you don't need to keep a dictionary around. So less memory needed.
True that ! this question is meant for testing string manipulation skills and not to test compression algorithm skills.
I shall look into LZ approach though ! thanks for the info!