pub fn RabinKarpSearch(text: &str, pattern: &str, prime: u64) -> Vec<usize>
Expand description

Rabin-Karp algorithm for substring search.

§Arguments

  • text - The text in which to search for the pattern.
  • pattern - The pattern to search for.
  • prime - A prime number to use for hashing.

§Returns

A list of starting indices where the pattern is found in the text.