《数据结构课程设计》专业:计算机科学与技术姓名:周兵学号:一、需求分析一、设计代码:1. 直接插入排序:public class InsertSort { public static > void insertSort(T[] array) { for (int i = 1; i <= array.length - 1; i++) { int j = i; while (j>=1 && array[j].compareTo(array[j - 1]) < 0) { T temp = array[j]; array[j] = array[j - 1]; array[j - 1] = temp; j--; } } } public static void main(String[] args) { Integer[] testArray = {23, 25, 12, 42, 35,33,43,57}; System.out.println(" 排序前 :"); for (Integer item : testArray) { System.out.print(item); System.out.print(' '); } System.out.println(); System.out.println("-------------------"); InsertSort.insertSort(testArray); System.out.println(" 排序后 :"); for (Integer item : testArray) { System.out.print(item); System.out.print(' '); } } } 实验结果:2. 折半插入排序:public class BInsertSort { public static void bInsertSort(int[] temp) { int length = temp.length; for (int i = 1; i < length; i++) { int tempVal = temp[i]; int low = 0; int high = i - 1; while (low <= high) { int middle = (low + high) / 2; if (tempVal < temp[middle]) high = middle - 1; else low = middle + 1; } for (int j = i; j > high + 1; j--) temp[j] = temp[j - 1]; temp[high + 1] = tempVal; } } public static void main(String[] args) { int[] a = { 5, 1, 76, 2, 4, 84, 36, 22, 62, 90 }; bInsertSort(a); System.out.println("排序后:"); for (int i = 0; i < a.length; i++) System.out.print(a[i] + " "); }}实验结果:3. 希尔排序:public class InsertionSort {public void shellInertionSort(double [] sorted, int inc){ int sortedLen= sorted.length; for(int j=inc+1;j=0;k-=inc){...