Input : A set S of planar points
Output : A convex hull for S
Step 1: If S contains no more than five points, use exhaustive searching to find the convex hull and return.
Step 2: Find a median line perpendicular to the X-axis which divides S into Sl and SR Sl lies to the left of SR .
Step 3: Recursively construct convex hulls for Sl and SR. Denote these convex hulls by Hull(Sl) and Hull(SR) respectively.
Step 4: Apply the merging procedure to merge Hull(Sl) and Hull(SR) together to form a convex hull.
Time complexity:
T(n) = 2T(n/2) + O(n)
= O(n log n)