Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
157 views

Why is KMP preprocessing O(N)?

My intuition tells me that there is <=1 increase in lps for each increase in the index. Can someone make a better argument why this is O(N)? My confusion arises from ...
Ewin Zuo's user avatar