Hey everyone! I'm working on a project where I need to quickly identify which non-overlapping intervals certain numbers fall into. To do this efficiently, I want to first build an interval tree. I'm hoping to avoid programming this data structure from scratch, so if anyone knows of a good implementation, I'd really appreciate the recommendations. Thanks in advance!
1 Answer
Have you checked out Guava's `RangeSet`? It might fit your needs pretty well for handling these intervals.
I think `RangeMap` would be more suitable for me since I need to associate some information with my ranges. But this is definitely helpful, thanks!