Module 09 · DSA · Four patterns the ladders lean on · about 16 min to read
Walk the clock: sweep line
Meeting Rooms II · Open board
Bars on a timeline, one bar per meeting, and the question of how many bars stand over one moment.
Lesson 92 of 96 in DSA
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
See plansAlready a member? Sign in
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
- 1977: how much of the line is covered?
- Events: a bar becomes two moments
- The sweep line: one counter, one pass
- Why this is cheap
- The tie rule: two events at the same time
- The active set: when a counter is not enough
- The strip: area between two events
- The walk for Klee’s question
- LeetCode 2406, Divide Intervals Into Minimum Number of Groups
- LeetCode 218, The Skyline Problem
- LeetCode 850, Rectangle Area II
- The measured gap
- Where this idea shows up
Terms it explains: event, sweep line, tie rule, active set, strip, Common mistakes.
Review DSA
Saved in this browser, and to your account when you sign in.