GrahamScan Class |
The GrahamScan data type provides methods for computing the convex hull of a set of N points in the plane.
The implementation uses the Graham-Scan convex hull algorithm. It runs in O(N log N) time in the worst case and uses O(N) extra memory.
Namespace: Algs4Net
public class GrahamScan
The GrahamScan type exposes the following members.
Name | Description | |
---|---|---|
![]() | GrahamScan |
Computes the convex hull of the specified array of points.
|
Name | Description | |
---|---|---|
![]() | Hull |
Returns the extreme points on the convex hull in counterclockwise order. |
![]() ![]() | MainTest |
Demo test the ClosestPair data type.
Reads in an integer N and N points (specified by
their X- and Y-coordinates) from standard input;
computes their convex hull; and prints out the points on the
convex hull to standard output. |
For additional documentation, see Section 9.9 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
This class is a C# port from the original Java class GrahamScan implementation by the respective authors.