Click here to Skip to main content
15,895,283 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Algorithm or not? Pin
Alan Balkany8-Oct-08 7:24
Alan Balkany8-Oct-08 7:24 
GeneralRe: Algorithm or not? Pin
MNoordam8-Oct-08 8:54
MNoordam8-Oct-08 8:54 
GeneralRe: Algorithm or not? Pin
MNoordam16-Oct-08 1:15
MNoordam16-Oct-08 1:15 
GeneralRe: Algorithm or not? Pin
Alan Balkany16-Oct-08 3:19
Alan Balkany16-Oct-08 3:19 
GeneralRe: Algorithm or not? [modified] Pin
MNoordam16-Oct-08 3:41
MNoordam16-Oct-08 3:41 
GeneralRe: Algorithm or not? Pin
Alan Balkany17-Oct-08 3:54
Alan Balkany17-Oct-08 3:54 
QuestionMonte carlo Rabin_Karp Search Pin
Angelinna2-Oct-08 14:17
Angelinna2-Oct-08 14:17 
AnswerRe: Monte carlo Rabin_Karp Search Pin
Robert.C.Cartaino2-Oct-08 16:23
Robert.C.Cartaino2-Oct-08 16:23 
From this website[^].

Algorithm 9.2.8 Monte Carlo Rabin-Karp Search
This algorithm searches for occurrences of a pattern p in a text t. It prints out a list of indexes such that with high probability t[i..i +m− 1] = p for every index i on the list.

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 = 2m−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)
                  prinln("Match at position" + i)

            f[i + 1] = 2 * (f[i]- r * t[i]) + t[i + m] mod q
            i = i + 1
      }
} 

GeneralRe: Monte carlo Rabin_Karp Search Pin
Angelinna2-Oct-08 17:07
Angelinna2-Oct-08 17:07 
GeneralSign of the times... PinPopular
CPallini2-Oct-08 21:52
mveCPallini2-Oct-08 21:52 
GeneralRe: Monte carlo Rabin_Karp Search Pin
Paul Conrad3-Oct-08 6:28
professionalPaul Conrad3-Oct-08 6:28 
GeneralRe: Monte carlo Rabin_Karp Search Pin
Tim Craig3-Oct-08 18:34
Tim Craig3-Oct-08 18:34 
GeneralArray Rearrangement trick [modified] Pin
abhigad1-Oct-08 9:53
abhigad1-Oct-08 9:53 
GeneralRe: Array Rearrangement trick Pin
CPallini1-Oct-08 10:16
mveCPallini1-Oct-08 10:16 
GeneralRe: Array Rearrangement trick Pin
Alan Balkany2-Oct-08 3:42
Alan Balkany2-Oct-08 3:42 
GeneralRe: Array Rearrangement trick Pin
Mark Churchill2-Oct-08 5:16
Mark Churchill2-Oct-08 5:16 
QuestionDigit combination string [modified] Pin
z33z30-Sep-08 21:25
z33z30-Sep-08 21:25 
QuestionExternal sorting: Which algorithm to select Pin
lizardking3d29-Sep-08 1:45
lizardking3d29-Sep-08 1:45 
AnswerRe: External sorting: Which algorithm to select Pin
Alan Balkany1-Oct-08 3:36
Alan Balkany1-Oct-08 3:36 
GeneralRe: External sorting: Which algorithm to select Pin
lizardking3d5-Oct-08 20:48
lizardking3d5-Oct-08 20:48 
GeneralRe: External sorting: Which algorithm to select Pin
Alan Balkany6-Oct-08 3:29
Alan Balkany6-Oct-08 3:29 
GeneralRe: External sorting: Which algorithm to select Pin
lizardking3d6-Oct-08 4:08
lizardking3d6-Oct-08 4:08 
GeneralRe: External sorting: Which algorithm to select Pin
Alan Balkany6-Oct-08 4:22
Alan Balkany6-Oct-08 4:22 
GeneralRe: External sorting: Which algorithm to select Pin
Mark Churchill6-Oct-08 5:23
Mark Churchill6-Oct-08 5:23 
GeneralRe: External sorting: Which algorithm to select Pin
supercat921-Oct-08 12:49
supercat921-Oct-08 12:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.