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

Function build_bad_char_table

src/string/boyer_moore_search.rs:17–23  ·  view source on GitHub ↗

Builds the bad character table for the Boyer-Moore algorithm. This table stores the last occurrence of each character in the pattern. # Arguments `pat` - The pattern as a slice of characters. # Returns A `HashMap` where the keys are characters from the pattern and the values are their last known positions within the pattern.

(pat: &[char])

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

boyer_moore_searchFunction · 0.85

Calls 2

iterMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected