IntervalTree DeleteNode Java Implementation

前端 未结 5 1402
無奈伤痛
無奈伤痛 2021-02-06 08:14

I need an IntervalTree or RangeTree implementation in Java, and am having trouble finding one with working deletion support.

There\'s a built-in one at sun.jvm.hotspot.u

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-06 08:19

    I ended up modifying the sun.jvm.hotspot.utilities.IntervalTree to maintain a Set of deleted nodes. When doing a search, I exclude any items in this set. Not ideal, but this was a lot easier than getting "real" deletion working. Once the deleted set gets too large, I rebuild the tree.

提交回复
热议问题