Mind you, you could avoid eleven comparisons if you use the hash, Katie.
Make the data you want to search the key of a hash, and find things in constant time. Of course, it only works if you're looking for exact matches, not for aproximate matches, misspellings, or values which fall within a range.
In reply to Re: Binary searching with Perl.
by Anonymous Monk
in thread Binary searching with Perl.
by DigitalKitty
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |