Find an interior point ; Label it
,
Sort all other points angularly about ; label them as
,
Stack ; t indexes top
i = 3
while do
if
is left of
then Push(
and
increment i.
else Pop(
.
Complexity: The complexity of sorting is . The
while loop iterates
times. Total complexity is
.