Skip to content

Latest commit

 

History

History
55 lines (48 loc) · 2.98 KB

File metadata and controls

55 lines (48 loc) · 2.98 KB

Sweep Line Algorithm

Concept

  • We don't need to check any point, we only need to focus on the start and end of intervals

Procedure

  • Split the start point and end point of each intervals (also use additional information to identify start points and end points).
  • Sort the points based on position and types of points (or store points into priority queue).
  • Scan the points by order.

Complexity

Problems can use this pattern

  • Find intersections of intervals

Problems

References