When Do Two Intervals Touch?

After sorting, you scan pairs left-to-right. You need a single comparison that answers: do these two intervals overlap?

Drag and discover.

One Comparison, Four Cases

Drag the green interval. Find the rule. Then prove you own it.

Drag the green interval left and right. Watch when it overlaps 15.
0123456789101112[1,5][6,9]a.endb.start
b.start 6 > 5 a.endgap
Overlaps seen: Gaps seen: