Data structure to build and lookup set of integer ranges

前端 未结 7 1587
你的背包
你的背包 2020-12-19 09:58

I have a set of uint32 integers, there may be millions of items in the set. 50-70% of them are consecutive, but in input stream they appear in unpredictable ord

7条回答
  •  隐瞒了意图╮
    2020-12-19 10:22

    Rather than a 'comparison' based storage/retrieval ( which will always be O(log(n)) ), You need to work on 'radix' based storage/retrieval .

    In other words .. extract nibbles from the uint32, and make a trie ..

提交回复
热议问题