Technique
Convex Hull (Andrew's monotone chain)
Sort points and build lower and upper hulls with a stack that pops non-left turns, in O(n log n).
0%
mastery
0/1 solved
0/1 solved
Recognise it
The signal
smallest fence around points
1Brute force
Check every pair as a potential hull edge O(n3).
2The observation
Pair checks: sorted order plus a turn test keeps only hull vertices on the stack.
3Why it works
The stack always forms a convex chain of the processed points.
Reach for it when
- +farthest pair (rotating calipers)
- +lower envelope of lines (dual of CHT)
Not when
- ×collinear points requirement differs (keep or drop)
Practice
0/1 solved
- Convex HullCSESMedium
Pitfalls
Misconceptions
- !dropping collinear boundary points when the problem wants them