the kmp perpocess function is having “j” initialized as 1, but as explained in the previous video it should be -1…
correct me if i am wrong
the kmp perpocess function is having “j” initialized as 1, but as explained in the previous video it should be -1…
correct me if i am wrong
Yes the j can be initialised by -1 but it will not make any diffrence as the while loop will only run when j >= 0 and after i++ and j++ i will be 1 and j will be 0 to start with and also reset[j] will be i now.