title: How does the Failure function used in KMP algorithm work?
body: <p>I've tried my best reading most of the literature on this, and still haven't understood anything about how the failure function used in KMP algorithm is constructed. I've been referring mostly to <a href="http://community.topcoder.com/tc?module=Static&amp;d1=tutorials&amp;d2=stringSearching" rel="noreferrer">http://community.topcoder.com/tc?module=Static&amp;d1=tutorials&amp;d2=stringSearching</a> tutorial which most of the people consider excellent. However, I still have not understood it. I'd be thankful if you could take the pain of giving me a simpler and easy to understand explanation on it.</p>