摘要:
import java.util.Arrays; public class HeapSort { public static void main(String[] args) { int[] a = { 2, 5, 9, 6, 1, 4, 8, 7, 12, 50 }; sort(a); System.out.println(Array... 阅读全文
摘要:
public class MergeSort { public static void main(String[] args) { int[] A = { 1, 4, 3, 2, 5 }; mergeSort(A, 5); for (int i = 0; i < A.length; i++) { System.o... 阅读全文
摘要:
package Sort; import java.util.Arrays; public class ShellSort { public static void main(String[] args) { int[] a = { 54, 35, 48, 36, 27, 12, 44, 44, 8, 14, 26, 17, 28 }; sort(a... 阅读全文
摘要:
import java.util.*; public class Select{ public void getSelect(int[] array){ if(array == null || array.length == 0) return; for(int i=0;i<array.length 阅读全文
摘要:
import java.util.*; public class Insert{ public void getInsert(int[] array){ if(array == null || array.length == 0) return; int j=0; for(int i=1;i0&&(array[j-1]>temp);j--)... 阅读全文
摘要:
import java.util.*; public class QuickSort{ public void getQuick(int[] array,int left,int right){ if(array == null || array.length == 0) return ; if(left<right){ int m... 阅读全文