DSA Notes
My Blog
Home
Data Structures
Arrays
Linked Lists
Stacks
Priority Queues
Algorithms
Sorts
Binary Search
Dynamic Programming
Stringology
Exact Match
Misc
Maximal Rectangle Problem
Line Sweeping
Algorithms
Related Topic
Reading
Scheduling
Journey
Python Tricks
DSA Notes
Misc
Line Sweeping
Line Sweeping Algorithm
Algorithms
Use a counter to keep track when we enter an interval (
+1
) and when exiting it (
-1
).
Use prefix sum to find the maximum value (the time when it is the most overlapped).
Related Topic
Scheduling Problems
Reading
Line Sweep Algorithms
« Previous
Next »