Z-Function vs KMP Failure Function in String Problems
Z-function works forward, KMP looks back—pick the one that matches your problem's natural direction.
Adaeze Nwofor
Staff Writer
Adaeze holds a master's degree in theoretical computer science from the University of Lagos and has written about algorithmic problem solving for academic and hobbyist audiences alike since 2018. Her beat centers on string algorithms and the mathematical foundations that underpin competitive programming puzzles.
1 story
Z-function works forward, KMP looks back—pick the one that matches your problem's natural direction.