ELI5: Explain Like I'm 5

Interval tree

Interval trees are like a regular tree, except instead of writing things like "Cat" or "Apple" on the branches, you write numbers. You can start at 0 on the left and go up to 10 on the right. Then, you draw lines across the tree pointing to different numbers. These lines represent intervals.

For example, you might draw a line from 0 to 6, and another line from 2 to 5. You can also draw lines connecting the numbers that are not touching. So, if you drew a line between 3 and 6, that line would represent the interval 3-6.

Then, whenever you want to find if a number lies within an interval, all you have to do is look at the tree and see if your number is on any of the lines. If it is, then you know the number is within that interval.