HomeAlgorithms & AIInterval Trees: Finding Every Overlapping Time Range Instantly

🌳 Interval Trees: Finding Every Overlapping Time Range Instantly

Explore how interval trees use an augmented binary search tree to find every stored range that overlaps a query in logarithmic time, with a worked example and real-world uses in scheduling and bioinformatics.

Algorithms & AI3DModerate60 FPS
interval-tree-lab ↗ Open standalone

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.

⚙ Under the hood

Explore how interval trees use an augmented binary search tree to find every stored range that overlaps a query in logarithmic time, with a worked example and real-world uses in scheduling and bioinformatics.

interval-treedata-structuresalgorithmsbinary-search-treeschedulingbioinformaticscomputational-geometryoverlap-search

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)