It is KMP pattern search algorithm.