Content deleted Content added
→Runtime: It is given in the code for manachers algo that "while Center < length(S')" that is less than 2n+1 not less than equal. I changed 2n+1 to 2n to correct it. Tags: Reverted Visual edit |
|||
Line 166:
===Runtime===
The algorithm runs in linear time. This can be seen by noting that <code>Center</code> strictly increases after each outer loop and the sum <code>Center + Radius</code> is non-decreasing. Moreover, the number of operations in the first inner loop is linear in the increase of the sum <code>Center + Radius</code> while the number of operations in the second inner loop is linear in the increase of <code>Center</code>. Since <code>Center ≤ 2n
==Notes==
|