Graham scan when the points are already sorted by one of the coordinates

78 views Asked by At

The Wikipedia entry for convex hull algorithms states:

Graham scan — O(n log n) A slightly more sophisticated, but much more efficient algorithm, published by Ronald Graham in 1972. If the points are already sorted by one of the coordinates or by the angle to a fixed vector, then the algorithm takes O(n) time.

However, I couldn't find any references taking as input a list of points sorted by one of the coordinates. In that case, is there a preliminary step that needs to be done to get them sorted by the angle? Trying a few examples, I don't think I can just use the points sorted by, let's say, the x-axis value in the same way I use them sorted by the angle.

0

There are 0 answers