黑马程序员技术交流社区

标题: 直接插入排序 [打印本页]

作者: 瑞雪雄起    时间: 2015-9-28 17:56
标题: 直接插入排序
public class DirectInsertSort {
       
public static void DirSort(int[] array)
{
int Row=array.length-1;
for(int I=1;I<=Row;I++)
{
int temp=array[I];
int V=I-1;
while(V>=0&&array[V]>temp)
{
array[V+1]=array[V];
V--;
}
array[++V]=temp;
}
}       
}




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2