MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / compute_prefix_match

Function compute_prefix_match

src/string/shortest_palindrome.rs:73–84  ·  view source on GitHub ↗

Computes the prefix matches of the original string against its reversed version using the suffix table. # Arguments `original` - A slice of characters representing the original string. `reversed` - A slice of characters representing the reversed string. `suffix` - A slice containing the suffix table computed for the original string. # Returns Returns a vector of `usize` where each element at i

(original: &[char], reversed: &[char], suffix: &[usize])

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