For frequent use, make a hash
Yes. (But don't do this with refs.) There are compromises too, like binary searches and Tie::IxHash and other modules. Lots of different trade-offs can be made between ordering restrictions, code complexity, execution time, and space requirements. The trick is picking the right one. :-)
-sauoq "My two cents aren't worth a dime.";
In reply to Re^2: how to quickly tell if number is in an array
by sauoq
in thread how to quickly tell if number is in an array
by redss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |