Is TRIE the most recommended data structure when developing something like a dictionary for storing words? Any other alternatives that improve memory time or performance?
I believe that a hash can be good if there is no collision, but then the memory requirements start to become bad for overlapping words: overlap, overlap, overlap, overlap, overlap all occupy exceptional storage, while we could share the space in trie .
EDIT: Thanks to @Moron and all of you for the very helpful answers. I agree - hash key generation is O (n), as well as TRIE search. However, it can be worse for hash things when the chain adds time, but for TRIE this will not happen. My concern is that for each node in TRIE I need to hold a pointer that can blow if the dictionary size is small.
source
share