Documentation
¶
Overview ¶
Package quick implements Tony Hoare's Quicksort and Quickselect.
This package avoids quadratic behavior by using median-of-ninthers when a bad pivot is detected.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Select ¶
Select uses the Quickselect algorithm to find element k of the slice, partially sorting the slice around, and returning, s[k]. It uses O(n) time and O(log₉(n)) space.
func Sort ¶
Sort uses the Quicksort algorithm to sort a slice. It uses O(n·log(n)) time and O(log(n)) space.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.