DSA Studio
Search
Home
Sign in
Geometry Basics Checkpoint
Orientation, line sweep, and closest pair.
1. The sign of the cross product indicates:
Clockwise vs counterclockwise orientation
Distance between points
Midpoint of a segment
Slope only
2. Line sweep sorts events by coordinate and tracks active intervals.
3. Closest-pair divide-and-conquer checks only a few neighbors in the strip:
Up to 7 neighbors by y-order
All points in the strip
Only the closest x-neighbor
Only the closest y-neighbor
4. Segment intersection uses orientation plus:
On-segment checks for collinear cases
Sorting all points by x
BFS on a graph
Binary search on answer
Submit quiz
Auto-advance on pass