Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Monte carlo Rabin_Karp implementation

Monte carlo Rabin_Karp implementation

Scheduled Pinned Locked Moved C#
7 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Angelinna
    wrote on last edited by
    #1

    Where can I find sample codes showing implementation of Monte Carlo rabin_karp search NOT just a pseudocode. Thanks

    J 1 Reply Last reply
    0
    • A Angelinna

      Where can I find sample codes showing implementation of Monte Carlo rabin_karp search NOT just a pseudocode. Thanks

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      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

      A B 2 Replies Last reply
      0
      • J Judah Gabriel 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

        A Offline
        A Offline
        Angelinna
        wrote on last edited by
        #3

        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

        M realJSOPR 2 Replies Last reply
        0
        • A Angelinna

          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

          M Offline
          M Offline
          MumbleB
          wrote on last edited by
          #4

          I would suggest trying the Mathematics and Algorithms forumn. I'm sure somebody on there might know what you talking about.

          Excellence is doing ordinary things extraordinarily well.

          1 Reply Last reply
          0
          • A Angelinna

            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

            realJSOPR Online
            realJSOPR Online
            realJSOP
            wrote on last edited by
            #5

            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

            P 1 Reply Last reply
            0
            • realJSOPR realJSOP

              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

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              I'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.

              My blog | My articles | MoXAML PowerToys

              1 Reply Last reply
              0
              • J Judah Gabriel 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

                B Offline
                B Offline
                blackjack2150
                wrote on last edited by
                #7

                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?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups