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

Function calc_mismatch_shift

src/string/boyer_moore_search.rs:62–71  ·  view source on GitHub ↗

Calculates the shift when a mismatch occurs in the Boyer-Moore algorithm. The bad character rule is used to determine how far to shift the pattern. # Arguments `mis_idx` - The mismatch index in the pattern. `shift` - The current shift of the pattern on the text. `text` - The text as a slice of characters. `bad_char_table` - The bad character table built for the pattern. # Returns The number of p

(
    mis_idx: isize,
    shift: isize,
    text: &[char],
    bad_char_table: &HashMap<char, isize>,
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

boyer_moore_searchFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected