![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java算法排序
农码个一
这个作者很懒,什么都没留下…
展开
-
使用冒泡法对数组排序
static void bubbleSortedArray(int[] array){ for(int i = 0;i for(int j = 0;j if(array[j] > array[j + 1]){ int t = array[j]; array[j] = array[j + 1]; array[j + 1] = t; } } } }原创 2017-02-27 20:31:33 · 545 阅读 · 0 评论 -
使用选择法对数组排序
static void selectSortedArray(int[] array){ for(int i = 0;i for(int j = i + 1;j if(array[i] > array[j]){ int t = array[i]; array[i] = array[j]; array[j] =t; } } } }原创 2017-02-27 20:34:31 · 1598 阅读 · 0 评论