Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: fastest way to compare two arrays

by pajout (Curate)
on Apr 14, 2011 at 08:09 UTC ( #899377=note: print w/replies, xml ) Need Help??


in reply to fastest way to compare two arrays

divide et impera
1. @range is not necessary - there is just information of minimum and maximum.
2. If your @ports are sorted, imagine for a while that 100th item is wanted result. It means that 99th item has value 50098 and 100th item is greater than 50099. Check the half index of your range. If it is greater than expected value, seek left side, else seek right side. Seeking left xor right side, it is same problem, but amount of items is half.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://899377]
help
Chatterbox?
[LanX]: unusual that "Pimp my Bride" never made it into TV (?)
LanX sighs ... no idea stupid enough
[choroba]: "Smack My Bitch Up" did, though
[Eily]: that's the internet for you LanX
[Eily]: and I'm pretty sure there's a rule somewhere that states that the stupider the idea, the more likely it is to already have been done
zentara is thinking of moving to Mars to esacpe it all
[LanX]: Zentara eq Dr Manhatten ?

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-03-27 15:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.