//! 直接插入排序

pub fn sort<T:Copy + PartialOrd>(data:&mut Vec<T>){
	let mut tmp;
	let n = data.len();
	for i in 1..n{
		if data[i] < data[i - 1]{
			tmp = data[i];
			data[i] = data[i - 1];
			let mut jj = 0;
			for j in (0..i).rev(){
				data[j+1] = data[j];
				jj = j;
				if tmp > data[j]{
					break;
				}
			}
			data[jj+1] = tmp;
		}
	}
}
