14,920,477 members
Home / Discussions / Algorithms

# Algorithms

 Re: Algorithm or not? Alan Balkany8-Oct-08 7:24 Alan Balkany 8-Oct-08 7:24
 Re: Algorithm or not? MNoordam8-Oct-08 8:54 MNoordam 8-Oct-08 8:54
 Re: Algorithm or not? MNoordam16-Oct-08 1:15 MNoordam 16-Oct-08 1:15
 Re: Algorithm or not? Alan Balkany16-Oct-08 3:19 Alan Balkany 16-Oct-08 3:19
 Re: Algorithm or not? [modified] MNoordam16-Oct-08 3:41 MNoordam 16-Oct-08 3:41
 Re: Algorithm or not? Alan Balkany17-Oct-08 3:54 Alan Balkany 17-Oct-08 3:54
 Monte carlo Rabin_Karp Search Angelinna2-Oct-08 14:17 Angelinna 2-Oct-08 14:17
 Re: Monte carlo Rabin_Karp Search Robert.C.Cartaino2-Oct-08 16:23 Robert.C.Cartaino 2-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. Copy Code ```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 } } ```
 Re: Monte carlo Rabin_Karp Search Angelinna2-Oct-08 17:07 Angelinna 2-Oct-08 17:07
 Sign of the times... CPallini2-Oct-08 21:52 CPallini 2-Oct-08 21:52
 Re: Monte carlo Rabin_Karp Search Paul Conrad3-Oct-08 6:28 Paul Conrad 3-Oct-08 6:28
 Re: Monte carlo Rabin_Karp Search Tim Craig3-Oct-08 18:34 Tim Craig 3-Oct-08 18:34
 Re: Array Rearrangement trick CPallini1-Oct-08 10:16 CPallini 1-Oct-08 10:16
 Re: Array Rearrangement trick Alan Balkany2-Oct-08 3:42 Alan Balkany 2-Oct-08 3:42
 Re: Array Rearrangement trick Mark Churchill2-Oct-08 5:16 Mark Churchill 2-Oct-08 5:16
 Digit combination string [modified] z33z30-Sep-08 21:25 z33z 30-Sep-08 21:25
 External sorting: Which algorithm to select lizardking3d29-Sep-08 1:45 lizardking3d 29-Sep-08 1:45
 Re: External sorting: Which algorithm to select Alan Balkany1-Oct-08 3:36 Alan Balkany 1-Oct-08 3:36
 Re: External sorting: Which algorithm to select lizardking3d5-Oct-08 20:48 lizardking3d 5-Oct-08 20:48
 Re: External sorting: Which algorithm to select Alan Balkany6-Oct-08 3:29 Alan Balkany 6-Oct-08 3:29
 Re: External sorting: Which algorithm to select lizardking3d6-Oct-08 4:08 lizardking3d 6-Oct-08 4:08
 Re: External sorting: Which algorithm to select Alan Balkany6-Oct-08 4:22 Alan Balkany 6-Oct-08 4:22
 Re: External sorting: Which algorithm to select Mark Churchill6-Oct-08 5:23 Mark Churchill 6-Oct-08 5:23
 Re: External sorting: Which algorithm to select supercat921-Oct-08 12:49 supercat9 21-Oct-08 12:49
 Last Visit: 31-Dec-99 18:00     Last Update: 12-Jun-21 13:35 Refresh ᐊ Prev1...170171172173174175176177178179 Next ᐅ