DSA Master › Topic 6

Sorting & Intervals

Sorting often turns a hard problem into a linear scan. For intervals, sort by start to merge them, or by end for greedy scheduling (keep as many non-overlapping intervals as possible).

Concepts

How to recognise it

Common pitfalls

Problems

  1. Merge Intervals (Medium)
  2. Insert Interval (Medium)
  3. Non-overlapping Intervals (Medium)
  4. Meeting Rooms II (Medium, Premium)
  5. Minimum Number of Arrows to Burst Balloons (Medium)
  6. Largest Number (Medium)
  7. Sort an Array (Medium)