Interval Tree Visualizer
Build an augmented interval tree, inspect each subtree max endpoint, and follow the search path for an overlapping interval.
Interval input
The first 24 interval pairs are inserted in the order shown.
Overlap query
Step controls
Step 1 of 5: Start overlap search for [21, 23] at the root.
Interval tree diagram
Start overlap search for [21, 23] at the root.
Intervals
Search summary
Trace
What is an Interval Tree Visualizer?
An interval tree visualizer shows how overlapping ranges can be stored in an augmented binary search tree.
This tool orders intervals by their start value. Each node stores its own interval and the maximum high endpoint in its subtree. During an overlap search, that max value tells the algorithm whether the left subtree can still contain a matching interval.
For the full cluster of related pages, browse the Data Structure Visualizers hub.
How to use this interval tree visualizer
- Paste interval pairs such as
[[15, 20], [10, 30], [17, 19]]. - Choose a query interval.
- Run the overlap search.
- Follow the highlighted path through the tree.
- Inspect each node’s
maxvalue to see why the search moves left or right.
Interval tree search rule
At each node, the search first checks whether the current interval overlaps the query. If it does, the search can stop. If not, the algorithm checks the left child’s max value. When left.max >= query.low, the left subtree may contain an overlap; otherwise the search moves right.
Compare this page with the Merge Intervals Visualizer, Segment Tree Visualizer, and Binary Search Tree Visualizer.