Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Efficient selection mechanism?

by Corion (Patriarch)
on Jan 14, 2014 at 14:40 UTC ( [id://1070563]=note: print w/replies, xml ) Need Help??


in reply to Efficient selection mechanism?

This is a brute force approach:

I would pack the four small integers as bits in a 32-bit integer instead of using an array. Then the problem reduces to scanning that array and checking each bit against the bitmask.

If you sort the 32-bit integers, you get a quick way of eliminating half of the search space by looking at the highest bit.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found