Click or drag to resize
Quick Class
The Quick class provides static methods for sorting an array and selecting the ith smallest element in an array using quicksort.
Inheritance Hierarchy
SystemObject
  Algs4NetQuick

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

The Quick type exposes the following members.

Methods
  NameDescription
Public methodStatic memberMainTest
Reads in a sequence of strings from standard input; quicksorts them; and prints them to standard output in ascending order. Shuffles the array and then prints the strings again to standard output, but this time, using the select method.
Public methodStatic memberSelect
Rearranges the array so that a[k] contains the kth smallest key; a[0] through a[k-1] are OrderHelper.Less than (or equal to) a[k]; and a[k+1] through a[N-1] are greater than (or equal to) a[k].
Public methodStatic memberSort
Rearranges the array in ascending order, using the natural order.
Top
Remarks
For additional documentation, see Section 2.1 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class Quick implementation by Robert Sedgewick and Kevin Wayne.

See Also