raihatneloy's blog

By raihatneloy, 10 years ago, In English

Can this problem be solved using Suffix Automaton? I want to know if we can solve this using this algorithm. Can anyone please share any ideas? Thanks in advance :)

  • Vote: I like it
  • -2
  • Vote: I do not like it

»
10 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Actually it's a problem on KMP algorithm...

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I have already solved using KMP & DFS. But i want to know if it has any idea on SAM.

»
10 years ago, # |
  Vote: I like it +5 Vote: I do not like it

You don't even need suffix automata, I think you can do it in O(N) just with tree DFS and kmp :)

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I have already solved using KMP & DFS. But i want to know if it has any idea on SAM.