|
 |
 |
 |
 |
 |
 |
| • |
To
show this, we need to
|
|
|
|
build
a routine that can sort
|
|
|
any
set of numbers by
|
|
|
making
a subroutine call to
|
|
|
|
ConvexHull
|
|
|
|
 |
 |
 |
 |
 |
 |
Sort(X[1..n]):
|
|
|
for i = 1 to n do
|
|
|
Point p[i] = (X[i],X[i]^2);
|
|
array ch = ConvexHull(p);
|
|
|
for i = 1 to n do
|
|
|
s[i] = ch[i].x;
|
|
|
return s;
|
|
|
end.
|
|
|
|