Closed jonbrandenburg closed 1 year ago
Let's say the input string is "hello". Then we have the following situation:
h e l l o
0 1 2 3 4 5
so here we have n=5
. The array length is 6, which is n+1, not n+2. Does that help?
It does indeed. Thank you very much!
So the takeaway I have is that the chart represents positions in the interstitial space between each character in the input string with the start and end of string being special case which makes sense given the nature of the algorithm.
Thanks again!
There appears to be a discrepancy in the description of the algorithm.
Unless I am mistaken the length of the array, as described in these two sentences is actually n+2. Else how do you have a slot both before and after an input of length n and end up with n+1?