rabin-karp Questions

3

Solved

I am having trouble understanding how the rolling hash algorithm works after the hash has been reduced to modulus value by dividing by a prime number. Consider the sequence of 5 digits in the numb...
Myers asked 23/4, 2016 at 17:26

4

Solved

I'm looking for an efficient hash function for Rabin-Karp algorithm. Here is my actual code (C programming language). static bool f2(char const *const s1, size_t const n1, char const *const s2, ...
Maenad asked 18/7, 2012 at 17:13

3

Solved

I'm learning about string searching algorithms and understand how they work but haven't found a good enough answer about in which cases Rabin-Karp algorithm would be more effective than KMP or Boye...
Unmarked asked 2/6, 2019 at 20:35

2

In the Top Coder's code of RK algorithm: // correctly calculates a mod b even if a < 0 function int_mod(int a, int b) { return (a % b + b) % b; } function Rabin_Karp(text[], pattern[]) { // ...
Pictorial asked 20/8, 2016 at 14:1

2

I'm trying to understand why the worst case running time of the Rabin-Karp algorithm is O(nm) and the average case is O(n+m). Can someone help me with that?
Epiphragm asked 9/9, 2016 at 8:49

7

Solved

I posed a question to Stackoverflow a few weeks ago about a creating an efficient algorithm to search for a pattern in a large chunk of text. Right now I am using the String function indexOf to do ...
Penitent asked 16/3, 2012 at 16:43

1

Solved

I have generated an string using the following alphabet. {A,C,G,T}. And my string contains more than 10000 characters. I'm searching the following patterns in it. ATGGA TGGAC CCGT I have asked...
Metalinguistics asked 28/4, 2014 at 9:3

3

What are the available string matching algorithms besides Knuth-Morris-Pratt, Rabin-Karp and likes of it?

2

Solved

I've been trying to implement Rabin-Karp algorithm in Java. I have hard time computing the rolling hash value in constant time. I've found one implementation at http://algs4.cs.princeton.edu/53subs...
Saltpeter asked 24/5, 2011 at 11:23

2

I've seen this Rabin Karp string matching algorithm in the forums on the website and I'm interested in trying to implement it but I was wondering If anyone could tell me why the variables ulong Q a...
Schecter asked 26/4, 2012 at 17:26

3

Solved

I am interested in implementing the Rabin-Karp algorithm to search for sub strings as stated on wiki: http://en.wikipedia.org/wiki/Rabin-Karp_string_search_algorithm. Not for homework, but for self...
Douro asked 21/4, 2012 at 6:47

1

Solved

i am using Rabin–Karp algorithm to check plagiarism for any two source code files so firstly i simply implement its algorithm in c # here its code but its average and best case running time is O(n...
Turgot asked 8/12, 2011 at 21:25

2

Solved

I've been working on a Rabin-Karp string matching function in C++ and I'm not getting any results out of it. I have a feeling that I'm not computing some of the values correctly, but I don't know w...
Ailsun asked 4/12, 2010 at 1:29

3

I'm looking to use a rolling hash function so I can take hashes of n-grams of a very large string. For example: "stackoverflow", broken up into 5 grams would be: "stack", "tacko", "ackov", "ck...
Hord asked 22/2, 2010 at 21:8

2

Solved

According to the wikipedia entry on Rabin-Karp string matching algorithm, it can be used to look for several different patterns in a string at the same time while still maintaining linear complexit...
Receivership asked 23/8, 2009 at 9:10
1

© 2022 - 2025 — McMap. All rights reserved.