Representing sparse integer sets?

后端 未结 4 1812
抹茶落季
抹茶落季 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条回答
  •  长情又很酷
    2021-01-04 06:05

    You are referring to a judy array. It was a HP project. I think they are used in ruby and are available in c. Very interesting data structure. Making use of the fact that allocations are (at least) word aligned, having separate structures for dense and sparse ranges.

    http://judy.sourceforge.net/index.html

提交回复
热议问题