/ Published in: Haskell
problem 11, modified run-length encoding
========================================
If an element has no duplicates, mark it as such.
Example:
encodeModified "aaaabccaadeeee"
[Multiple 4 'a',Single 'b',Multiple 2 'c',
Multiple 2 'a',Single 'd',Multiple 4 'e']
problem 12, Decode a run-length encoded list.
=============================================
Given a run-length code list generated as specified in problem 11. Construct its uncompressed version.
Example:
decodeModified
[Multiple 4 'a',Single 'b',Multiple 2 'c',
Multiple 2 'a',Single 'd',Multiple 4 'e']
"aaaabccaadeeee"
========================================
If an element has no duplicates, mark it as such.
Example:
encodeModified "aaaabccaadeeee"
[Multiple 4 'a',Single 'b',Multiple 2 'c',
Multiple 2 'a',Single 'd',Multiple 4 'e']
problem 12, Decode a run-length encoded list.
=============================================
Given a run-length code list generated as specified in problem 11. Construct its uncompressed version.
Example:
decodeModified
[Multiple 4 'a',Single 'b',Multiple 2 'c',
Multiple 2 'a',Single 'd',Multiple 4 'e']
"aaaabccaadeeee"
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
URL: http://www.haskell.org/haskellwiki/99_questions/11_to_20