Up: Reductions
Definition: A sequence of points Si = (xi, yi), for i = 1 to k is a convex polygon (in counterclockwise order) if, in the sequence T of size k+2 consisting S1, ..., Sk, S1, S2, each adjacent triple of points Ti, Ti+1, Ti+2 represents a a left turn, for i = 1 to k. The convex hull of a point set P is a subset S of P such that S is a convex polygon and every point of P-S is interior to S.
Problem Convex Hull(S)
Input: S is a sequence of points (xi,yi) in the plane.
Output: permute S and return k such that S1, ... Sk is the convex hull of S.
The reduction of Sorting problem to Convex Hull problem:
Reduction sortByConvexHull(S){// S is a sequence of numbers.