Re:Aguri: Coolest Data Structure You've Never Heard Of
by Tichy on Tuesday January 22, 2008 @07:24AM
(#102157)
For hash tables you need to compute the hash function and execute an equals operation. Computing the hash function might take longer than traversing a tree. For example, if you key is "sdolkfhasodfgkokjhdfgfnaryksfdksfdgkjgf" the hash function will probably take every single letter into account (>20 operations, didn't count), whereas a binary tree might only need to look at the first letter at most nodes. So at least for relatively few entries, trees might perform better than hashtables, O(1) nonwithstanding.
[ Parent
| on HN ]
There are no comments on this comment yet.