Home | History | Annotate | Download | only in sort

Lines Matching defs:Sort

7 // Package sort provides primitives for sorting slices and user-defined
9 package sort
11 // A type, typically a collection, that satisfies sort.Interface can be
18 // index i should sort before the element with index j.
24 // Insertion sort
71 // ``Engineering a Sort Function,'' SP&E November 1993.
75 // sort 3 elements
213 // Sort sorts data.
215 // data.Less and data.Swap. The sort is not guaranteed to be stable.
216 func Sort(data Interface) {
232 // auto-generated func-optimized variant of sort.go in
275 // Sort is a convenience method.
276 func (p IntSlice) Sort() { Sort(p) }
291 // Sort is a convenience method.
292 func (p Float64Slice) Sort() { Sort(p) }
301 // Sort is a convenience method.
302 func (p StringSlice) Sort() { Sort(p) }
307 func Ints(a []int) { Sort(IntSlice(a)) }
311 func Float64s(a []float64) { Sort(Float64Slice(a)) }
314 func Strings(a []string) { Sort(StringSlice(a)) }
535 Plain merge sort performs log(n) = k iterations.
538 Thus iteration i of merge sort performs:
549 and should not be influenced by the initial insertion sort phase:
550 Insertion sort is O(n^2) on Swap and Less, thus O(bs^2) per block of
551 size bs at n/bs blocks: O(bs*n) Swaps and Less during insertion sort.
552 Merge sort iterations start at i = log(bs). With t = log(bs) constant: