Representing sparse integer sets?

后端 未结 4 1791
抹茶落季
抹茶落季 2021-01-04 05:47

What is a good way to represent sparse set of integers (really C memory addresses) in a compact and fast way. I already know about the obvious things like bit-vectors and ru

4条回答
  •  萌比男神i
    2021-01-04 06:26

    A very compact data structure would be a bloom filter, perhaps a counting bloom filter to support deletions.

    http://en.wikipedia.org/wiki/Bloom_filter

    The Bloom filter, conceived by Burton H. Bloom in 1970, is a space-efficient probabilistic data structure that is used to test whether an element is a member of a set. False positives are possible, but false negatives are not. Elements can be added to the set, but not removed (though this can be addressed with a counting filter)

提交回复
热议问题