[−][src]Function algorithmplus::sort::tim_sort
pub fn tim_sort<T: PartialEq + PartialOrd + Copy>(arr: &mut [T])
Sort an array using tim sort
Parameters
arr
: A vector to sort in-place
Type parameters
T
: A type that can be checked for equality and ordering e.g. ai32
, au8
, or af32
.
Undefined Behavior
Does not work with String
vectors.
Examples
use algorithmplus::sort::tim_sort; let mut ls = vec![3, 2, 1]; tim_sort(&mut ls); assert_eq!(ls, [1, 2, 3]);