I don't understand why you think I'm doing something different?
Oh, I don't really. The OP said "hash" and "single entry" so I felt like a Berkeley was the right answer (if the up front cost of building it is acceptable). Your solution is more flexible and really cool. I just thought my suggestion wasn't a "sledgehammer" but possibly a perfect fit. :)
Update: I'll see if I can post a 1,000 searches match too; I have to rebuild the thing so it might be later.
Update to the update: it was about 9 times slower to do 1,000 look-ups, clocking in at .15 for the most part (1.42 GHz G4 Mac).
In reply to Re^4: Rapid text searches ( O(1) space and time)
by Your Mother
in thread Rapid text searches
by joomanji
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |