插入排序public static void insertSort(int[] arr, int l, int r){ for(int i = l + 1; i <= r; i++){ int tmp = arr[i]; int j; // 提前终止,当元素全部...
最简单的冒泡排序public class MaoPao { public static void main(String[] args) { Integer[] datas = {2,4,5,3,1,8,1,4,3}; maoPao(datas); Syste...
归并排序算法/** * 归并排序 */public class MergeSort { public static void mergeSort(int[] arr, int l, int r){ if(l >= r){ return; } ...