用Java语言实现的各种排序,包括插入排序、冒泡排序、选择排序、Shell排序、快速排序、归并排序、堆排序、SortUtil等。 Q
Y'-]
插入排序: J.nq[/Q=
: [y(<TLw
package org.rut.util.algorithm.support; m"R(_E5
g8Z14'Ke
import org.rut.util.algorithm.SortUtil; 8##jd[o&p~
/** ^U}0D^jDeE
* @author treeroot o[#a}5Y
* @since 2006-2-2 z"3c+?2
* @version 1.0 (zBQ^97]
*/ Z3dd9m#.]
public class InsertSort implements SortUtil.Sort{ oK6lCGM5
tOw
0(-:iq
/* (non-Javadoc) x8Sq+BY
* @see org.rut.util.algorithm.SortUtil.Sort#sort(int[]) _ LNPB$P
*/ %j@FZ
)a[
public void sort(int[] data) { ^&iV