本文共 403 字,大约阅读时间需要 1 分钟。
public class Main { public static void main(String[] args) { // TODO Auto-generated method stub //int[] test = {5,4,3,2,1}; //int test[] = {5,4,3,2,1}; 两种写法都可以,建议使用上一种写法 int[] test={49,38,65,97,76,13,27,49,78,34,12,64,5,4,62,99,98,54,56,17,18,23,34,15,35,25,53,51}; InsertionSort(test); } public static void InsertionSort(int[] a) { int key = -1; //每一轮循环的子数组的首元素 for( int k=0;k=0 && key
转载地址:http://zthii.baihongyu.com/