How Do I Choose Between a Hash Table and a Trie (Prefix Tree)?

后端 未结 8 1817
终归单人心
终归单人心 2020-11-27 09:13

So if I have to choose between a hash table or a prefix tree what are the discriminating factors that would lead me to choose one over the other. From my own naive point of

8条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 09:31

    Some (usually embedded, real-time) applications require that the processing time be independent of the data. In that case, a hash table can guarantee a known execution time, while a trie varies based on the data.

提交回复
热议问题