3

I would like to have int tree set implementation, which is optimized for sets with a lot of continuous regions.

For example, such tree could know that is contains entire region from 100 to 150 and hence searching for 120 ends once this region found.

Similarly, if set contains regions 500...506 and 508...600, then, once 507 is added, two regions are merged.

Similarly regions can be splitted if number removed

Dims
  • 47,675
  • 117
  • 331
  • 600

1 Answers1

2

I use SparseBitSet for a similar task.

Note that Guava RangeSet uses Integer not int

Karussell
  • 17,085
  • 16
  • 97
  • 197
sibnick
  • 3,995
  • 20
  • 20