Computer scienceAlgorithms and data structuresAlgorithmsString algorithmsSubstring search algorithms

Rabin-Karp algorithm

First step

Report a typo

Suppose you are applying the Rabin-Karp algorithm for the pattern ANNA and text BLUEBANANA . During the first step, you are expected to calculate the hash value of the pattern ANNA. After this, you should calculate the hash value of some specific substring of the text. Which one?

If the choice of the substring depends on the constants for the hash function, write IDK.

Answer example: BLUE

Enter a short text

Create a free account to access the full topic