Hashtables vs. balanced search trees, cont’d
-
A search tree can easily be used to return keys close in value to a given key, or to return the smallest key in the tree, or to output the keys in sorted order
-
A hashtable does not normally deal with ordering information efficiently
-
In a balanced search tree, delete is as efficient as insert
-
In a hashtable that uses open addressing, delete can be inefficient, and somewhat tricky to implement (easy with separate chaining though)
-
Overall, balanced search trees are rather difficult to implement correctly
-
Hash tables are relatively easy to implement, though they depend on a good hash function for good performance
CONTENTS PREVIOUS NEXT