Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: CSV Cross Referencing

by SuicideJunkie (Vicar)
on Dec 03, 2014 at 18:43 UTC ( [id://1109152]=note: print w/replies, xml ) Need Help??


in reply to Re^3: CSV Cross Referencing
in thread CSV Cross Referencing

That's essentially what the 2d hash does.

$buckets->{latitude}{longitude}. You're only checking things with a similar latitude, and among those, only the things with a similar longitude. The upside is you don't need to loop. Instead of doing a latitude compare against everything, you immediately O(1) have the short list of things of the same latitude. Then instead of doing a compare against the longitudes of everything remaining, you immediately have the short list of things that match both.

Log In?
Username:
Password:

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

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

    No recent polls found