MCPcopy Index your code
hub / github.com/TheAlgorithms/Rust / compute_suffix

Function compute_suffix

src/string/shortest_palindrome.rs:47–57  ·  view source on GitHub ↗

Computes the suffix table used for the KMP (Knuth-Morris-Pratt) string matching algorithm. # Arguments `chars` - A slice of characters for which the suffix table is computed. # Returns Returns a vector of `usize` representing the suffix table. Each element at index `i` indicates the longest proper suffix which is also a proper prefix of the substring `chars[0..=i]`.

(chars: &[char])

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

shortest_palindromeFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected