Skip to content

Commit

Permalink
Update rolling_hash_aka_Rabin_Karp.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
neilteng committed Jul 11, 2020
1 parent b01ab6f commit 932f05c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pattern_matching/rolling_hash_aka_Rabin_Karp.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//char_num:26
//prime_num:5123 -- the larger the less conflic.
// We can use has function: [CHAR_1*26^(len_pat-1)+CHAR_2*26^(len_pat-2)+...+CHAR_n*26^(len_pat-n)]%prime_number

// version 1
//complexity: ave :O(n); worst case: O(nm)

Expand Down

0 comments on commit 932f05c

Please sign in to comment.