Nim icon indicating copy to clipboard operation
Nim copied to clipboard

Manacher's Algorithm

Open dlesnoff opened this issue 2 years ago • 4 comments

Manacher's Algorithm finds the longest palindromic factor (substring) in linear time in the length of the string input.

dlesnoff avatar Apr 26 '23 14:04 dlesnoff

@SatinWuker Is it working on your side?

dlesnoff avatar Jul 07 '23 08:07 dlesnoff

@SatinWuker Is it working on your side?

It works really well 👍👍👍 thank you for your clear explanation and helpful comment on the file haha!

SatinWukerORIG avatar Jul 07 '23 10:07 SatinWukerORIG

As one may notice, I compute the indexes whenever I ask for the length and the string. This might impact performance for very long strings. We may prefer to pass the indexes as parameters and determine the length or the string itself from this precomputed argument. A better way to handle this would be to compute an object with None/Option[T] attributes, that we fill with precisely the information we want.

dlesnoff avatar Jul 09 '23 20:07 dlesnoff

@SatinWuker

It works really well +1+1+1 thank you for your clear explanation and helpful comment on the file haha!

Do you still require the variable name changes or would you like to approve the pull request?

dlesnoff avatar Jul 09 '23 20:07 dlesnoff