next up previous contents
Next: Exercises Up: Tries Previous: Reducing Memory Requirements: Smaller

More Trie Operations

 

The FIND, INSERT, and DELETE operations shown here can also be implemented via a hash table, as we will learn shortly. A properly constructed hash table has the same properties with respect to FIND, INSERT, and DELETE- all run in time proportional to the length of the key (since the hash function takes time proportional to the length of the key, and this time will dominate the operations in a good hash table), not the number of keys. Hash tables also are easy to modify so that they can deal with non-unique keys, which is extremely practical in some applications. Best of all, hash tables are relatively easy to implement and understand, and good implementations generally consume far less memory than tries. Given all of these properties, why would anyone still choose a trie?


next up previous contents
Next: Exercises Up: Tries Previous: Reducing Memory Requirements: Smaller

Dan Ellard
Mon Jul 21 22:30:59 EDT 1997