Manacher's algorithm (algorithm to find longest palindrome substring in linear time)

前端 未结 10 522
走了就别回头了
走了就别回头了 2020-12-22 16:02

After spending about 6-8 hours trying to digest the Manacher\'s algorithm, I am ready to throw in the towel. But before I do, here is one last shot in the dark: can anyone e

10条回答
  •  攒了一身酷
    2020-12-22 16:43

    I have found one of the best explanation so far at the following link:

    http://tarokuriyama.com/projects/palindrome2.php

    It also has a visualization for the same string example (babcbabcbaccba) used at the first link mentioned in the question.

    Apart from this link, i also found the code at

    http://algs4.cs.princeton.edu/53substring/Manacher.java.html

    I hope it will be helpful to others trying hard to understand the crux of this algorithm.

提交回复
热议问题