MCPcopy Create free account
hub / github.com/TheAlgorithms/C-Plus-Plus / kmp

Function kmp

strings/knuth_morris_pratt.cpp:53–70  ·  view source on GitHub ↗

* @brief KMP algorithm to find a pattern in a text * @param pattern string pattern to search * @param text text in which to search * @returns the starting index of the pattern if found * @returns `std::string::npos` if not found */

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

testsFunction · 0.85

Calls 3

getFailureArrayFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected