Sorting methods

Trait Sort

Method qsort

fn qsort(self)

Implementation of Sort for &'self mut [T] where <'self, T: Copy + Ord + Eq>

Method qsort

fn qsort(self)

Function merge_sort

fn merge_sort<T: Copy>(v: &[T], le: Le<T>) -> ~[T]

Merge sort. Returns a new vector containing the sorted list.

Has worst case O(n log n) performance, best case O(n), but is not space efficient. This is a stable sort.

Function quick_sort

fn quick_sort<T>(arr: &mut [T], compare_func: Le<T>)

Quicksort. Sorts a mut vector in place.

Has worst case O(n^2) performance, average case O(n log n). This is an unstable sort.

Function quick_sort3

fn quick_sort3<T: Copy + Ord + Eq>(arr: &mut [T])

Fancy quicksort. Sorts a mut vector in place.

Based on algorithm presented by ~[Sedgewick and Bentley] (http://www.cs.princeton.edu/~rs/talks/QuicksortIsOptimal.pdf). According to these slides this is the algorithm of choice for 'randomly ordered keys, abstract compare' & 'small number of key values'.

This is an unstable sort.

Function tim_sort

fn tim_sort<T: Copy + Ord>(array: &mut [T])