What should the union preserve?

Intervals [1,4], [2,3], [6,8].

Which gap must remain? Why can a nested interval never reduce the active end?

1 / 9

Ordering changes the proof

All-pairs overlap components are a correct starting model.

Sorting by start makes a gap final: later starts cannot bridge backward.

Does the same first-choice rule maximize a schedule?

2 / 9

Summary Ranges — predict before coding

A range ends exactly at a gap in the sorted unique input. Maximal consecutive runs are both sufficient and necessary for the smallest exact cover.

Decision: How should [-2,-1,1,3,4] be represented?

3 / 9

Merge Intervals — predict before coding

Sorting by start lets a single active interval summarize the union of everything overlapping the current component. Closed intervals that touch at an endpoint merge.

Decision: What does merging [[1,3],[3,5],[8,8]] produce?

4 / 9

Insert Interval — predict before coding

The input already supplies the sorted disjoint structure that Merge Intervals would otherwise have to build. Exploit it with before, overlapping, and after phases.

Decision: Insert [2,8] into [[1,2],[4,5],[8,10]]. What remains?

5 / 9

Non-overlapping Intervals — predict before coding

Maximizing the number retained is equivalent to minimizing removals. Keep the earliest-finishing compatible interval because it leaves the largest future opportunity.

Decision: How many intervals must be removed from [[1,2],[2,3],[1,3]]?

6 / 9

Minimum Number of Arrows to Burst Balloons — predict before coding

An arrow position must hit the earliest-ending remaining balloon. Move that mandatory arrow as far right as possible, to its end, without losing any useful earlier coverage.

Decision: How many arrows are needed for [[1,2],[2,3]], and where can the arrow be placed?

7 / 9

Interval List Intersections — predict before coding

Once the interval with the earlier end has been compared against its current counterpart, it cannot intersect a later interval from the other disjoint sorted list.

Decision: What is the intersection of [[1,2],[5,7]] and [[2,5]]?

8 / 9

Reconstruct and transfer

Reconstruct the two different exchange arguments.

Explain why the earlier-ending interval can be discarded in intersection.

Identify which routines mutate input order.

9 / 9
←/→ or click edges to navigate · ? help · N notes · F fullscreen