Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Fast Way to find one array in second array

by BrowserUk (Patriarch)
on Aug 14, 2016 at 06:47 UTC ( [id://1169737]=note: print w/replies, xml ) Need Help??


in reply to Fast Way to find one array in second array

Are the inner elements single characters as shown; or is that a placeholder for longer strings or numbers or ...?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Fast Way to find one array in second array

Replies are listed 'Best First'.
Re^2: Fast Way to find one array in second array
by melmoth (Acolyte) on Aug 14, 2016 at 16:51 UTC

    not sure what your asking, or if it's for me, but in the problem I raised each vertex is a string of alphanumeric characters

      or if it's for me

      I replied to your post; it is for you.

      not sure what your asking,

      Your data showed single characters: @array1 = [A,B,F,G]; if that was representative of your real data, there is an optimisation that could be used.

      each vertex is a string of alphanumeric characters

      The solution I posted will work for strings (or any other kind of data) and is the fastest solution possible. Over 50 times faster than 1169738; and correct.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Yes I saw that thanks I'm going to try it along with some other ideas and post back here how it went. thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1169737]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-25 05:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found