Article icon indicating copy to clipboard operation
Article copied to clipboard

十大经典排序算法动画,看我就够了!

Results 4 Article issues
Sort by recently updated
recently updated
newest added

第一张所有排序的复杂度总结图,希尔排序的最坏时间复杂度是不是错了?

GAP=5的排序结果: ![image](https://github.com/MisterBooo/Article/assets/45511100/f2d795f0-5dd6-4da0-b154-c0b3a421d4b9) GAP=2 ,步长为2,每两个比较元素之间只进行1次比较,不可能0能排到首个元素的位置。 ![image](https://github.com/MisterBooo/Article/assets/45511100/e27ef8b4-dece-4689-a592-57dcabaa3e21) 正确的排序结果应该是这个: 1 5 0 6 3 4 7 2 9 8

int[] left = Arrays.copyOfRange(arr, 0, middle);//左闭右开,奇数个元素拆分应该不包含右边的元素