← 🌳 Algorithms

🌳 Interval Trees: Finding Every Overlapping Time Range Instantly

Visited: 0
Overlaps: 0
Drag — rotate · Scroll — zoom

🌳 Interval Trees: Finding Every Overlapping Time Range Instantly

This simulator visualizes an interval tree built from a small set of intervals and shows how a query is answered by descending the tree and pruning subtrees whose max endpoint rules out any possible overlap.

🔬 What It Demonstrates

This simulator visualizes an interval tree built from a small set of intervals and shows how a query is answered by descending the tree and pruning subtrees whose max endpoint rules out any possible overlap.

🎮 How to Use

Add or adjust intervals to build the tree, then enter a query interval or point to watch the search traverse the tree, highlighting visited nodes, pruned subtrees, and the final overlapping matches.

💡 Did You Know?

A single max-endpoint comparison at the root of a large subtree can eliminate thousands of intervals from consideration in one step, which is why interval trees stay fast even as the stored collection grows very large.