Content deleted Content added
→Manacher's algorithm: I put some of the explanation of the algorithm as comments in the code so that it is clearer why it is working. Tags: Mobile edit Mobile web edit |
→Manacher's algorithm: Made one comment a little clearer. Tags: Mobile edit Mobile web edit |
||
Line 87:
'''else if''' PalindromeRadii[MirroredCenter] > MaxMirroredRadius '''{'''
// The palindrome at MirroredCenter is
// The palindrome at Center must end at the edge of the OldCenter palindrome
// Otherwise, the palindrome at OldCenter would be bigger
Line 96:
// Since the palindrome at MirroredCenter ends exactly at the edge of the palindrome centered at OldCenter,
// the palindrome at Center might be bigger
// Set Radius to the minimum size of the palindrome
Radius = MaxMirroredRadius
|