Need memory efficient way to store tons of strings (was: HAT-Trie implementation in java)

前端 未结 4 2135
野的像风
野的像风 2020-12-24 02:15

I am working with a large set (5-20 million) of String keys (average length 10 chars) which I need to store in an in memory data structure that supports th

4条回答
  •  清歌不尽
    2020-12-24 02:48

    Similar to a trie is a ternary search tree, but a ternary search tree has the advantage of using less memory. You can read about ternary search trees here, here, and here. Also one of the main papers on the subject by Jon Bentley and Robert Sedgewick is here. It also talks about sorting strings quickly, so don't be put off by that.

提交回复
热议问题