Click or drag to resize
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.

Inheritance Hierarchy
SystemObject
  Algs4NetGrahamScan

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class GrahamScan

The GrahamScan type exposes the following members.

Constructors
  NameDescription
Public methodGrahamScan
Computes the convex hull of the specified array of points.
Top
Methods
  NameDescription
Public methodHull
Returns the extreme points on the convex hull in counterclockwise order.
Public methodStatic memberMainTest
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.
Top
Remarks

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.

See Also