Finding the minimum length RLE

后端 未结 4 1610
感动是毒
感动是毒 2021-02-04 17:05

The classical RLE algorithm compresses data by using numbers to represent how many times the character following a number appears in the text at that position. For example:

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 17:41

    I do not believe dynamic programming will work here, as you could have sub-strings about half the length of the full string in the solution. Looks like you need to use brute force. For a related problem, check out the Lempel-Ziv-Welch Algorithm. It is an efficient algorithm that finds a minimal encoding by using substrings.

提交回复
热议问题