Monte carlo Rabin_Karp implementation
-
Where can I find sample codes showing implementation of Monte Carlo rabin_karp search NOT just a pseudocode. Thanks
Angelinna wrote:
Monte Carlo rabin_karp
What? Honestly, this is one of the strangest sounding questions I've heard in the last 4 years in this forum. A google search for monte carlo rabin_karp doesn't produce any results. Can you explain what it is? Then maybe we can help you.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Feelings-Based Morality of the Secular World The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
Angelinna wrote:
Monte Carlo rabin_karp
What? Honestly, this is one of the strangest sounding questions I've heard in the last 4 years in this forum. A google search for monte carlo rabin_karp doesn't produce any results. Can you explain what it is? Then maybe we can help you.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Feelings-Based Morality of the Secular World The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
This is a pseudocode for Monte Carlo rabin_karp algorithm. Input Parameters: p,t Output Parameters: None; Mc_rabin_karp_search(p,t) { m = p.length n = t.length q = randomly chosen prime number less than mn2 r = 2 ^(m-1) mod q //computation of initial remainders f[0]=0 pfinger = 0 for j = 0 to m-1 { f[0] = 2*f[0]+t[j] mod q pfinger = 2*pfinger + p[j]mod q } i = 0; while(i + m<=n) { if ( f[i] = = pfinger) println (“Match at position”+i) f[i + 1] = 2*(f[i] – r*t[i]) + t[i+m]mod q i = i +1 } } What am seeking is a sample of a working code to help me understand it actual implementation. Thanks
-
This is a pseudocode for Monte Carlo rabin_karp algorithm. Input Parameters: p,t Output Parameters: None; Mc_rabin_karp_search(p,t) { m = p.length n = t.length q = randomly chosen prime number less than mn2 r = 2 ^(m-1) mod q //computation of initial remainders f[0]=0 pfinger = 0 for j = 0 to m-1 { f[0] = 2*f[0]+t[j] mod q pfinger = 2*pfinger + p[j]mod q } i = 0; while(i + m<=n) { if ( f[i] = = pfinger) println (“Match at position”+i) f[i + 1] = 2*(f[i] – r*t[i]) + t[i+m]mod q i = i +1 } } What am seeking is a sample of a working code to help me understand it actual implementation. Thanks
-
This is a pseudocode for Monte Carlo rabin_karp algorithm. Input Parameters: p,t Output Parameters: None; Mc_rabin_karp_search(p,t) { m = p.length n = t.length q = randomly chosen prime number less than mn2 r = 2 ^(m-1) mod q //computation of initial remainders f[0]=0 pfinger = 0 for j = 0 to m-1 { f[0] = 2*f[0]+t[j] mod q pfinger = 2*pfinger + p[j]mod q } i = 0; while(i + m<=n) { if ( f[i] = = pfinger) println (“Match at position”+i) f[i + 1] = 2*(f[i] – r*t[i]) + t[i+m]mod q i = i +1 } } What am seeking is a sample of a working code to help me understand it actual implementation. Thanks
Are you saying you are unable to turn that pseudo code into a method? Maybe you should consider changing occupations. I'll pay you $50 to mow my yard.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Are you saying you are unable to turn that pseudo code into a method? Maybe you should consider changing occupations. I'll pay you $50 to mow my yard.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001I'll add my 50 to that, and she can clean my drive when she's finished your yard.
Deja View - the feeling that you've seen this post before.
-
Angelinna wrote:
Monte Carlo rabin_karp
What? Honestly, this is one of the strangest sounding questions I've heard in the last 4 years in this forum. A google search for monte carlo rabin_karp doesn't produce any results. Can you explain what it is? Then maybe we can help you.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Feelings-Based Morality of the Secular World The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
This might give you an idea: http://en.wikipedia.org/wiki/Monte_Carlo_method[^]. Of course if you're interested. Did you know that you can approximate the value of PI by throwing a needle on a piece of paper?