Skip to main content

Intervals

1 lessonAbout 6 minutesIntermediate

This part of the DSA Tutorial runs from Merging and Sorting Intervals. There is 1 lesson here, and working through them takes about 6 minutes at a steady pace.

It follows on from Searching, so finish that first if you have not already — the examples below assume you are comfortable with it.

Each lesson below says what it covers before you open it. Read them in order the first time; afterwards this page works as a index you can jump back into when you need to check one thing.

  1. 1Merging and Sorting IntervalsMerge overlapping intervals, insert into a sorted set, and detect conflicts. The interval pattern in JavaScript, and why sorting by start is almost always step one.