Hacker News new | ask | show | jobs
by chaos_vy 83 days ago
Intrusive trees are great for specialized use cases, but not for a general-purpose Java Collection. If the payload owns the left/right pointers, the same object can't cleanly participate in multiple Maps/Sets.

ChaosTree keeps the tree topology separate from the domain objects, which is necessary for a NavigableMap-style collection.

1 comments

You can have both! You can of course implement the non-intrusive case on top of the intrusive one. I think that opens up interesting use cases with Valhalla.