Find the smallest period of input string in O(n)?

后端 未结 5 529
渐次进展
渐次进展 2020-12-29 15:24

Given the following problem :

Definition :

Let S be a string over alphabet Σ .S\' is the smallest period of S

5条回答
  •  遥遥无期
    2020-12-29 16:01

    I'm not sure that I understand your attempted solution. KMP is a useful subroutine, though -- the smallest period is how far KMP moves the needle string (i.e., S) after a complete match.

提交回复
热议问题