Content deleted Content added
Line 25:
// Save the radius of the longest palindrome in the array
PalindromeRadii[Center] = 2*Radius
Center = Center+1
Line 35:
}
The runtime of this algorithm is <math>O(n^2)</math>. The outer loop runs <math>n</math> times and the inner loop can run up to <math>n/2</math> times.
==Manacher's algorithm==
|