简单选择排序是指一种排序算法,在简单选择排序过程中,所需移动记录的次数比较少。最好情况下,即待排序记录初始状态就已经是正序排列了,则不需要移动记录。 方法是设所排序序列的记录个数为n。i取1,2,…,n-1,从所有n-i+1个记录(Ri,Ri+1,…,Rn)中找出排序码最小的记录,与第i个记录交换。执行n-1趟 后就完成了记录序列的排序。
We looked at something called Selection Sort and that too was pretty straightforward, at least conceptually.
例如选择排序,至少从概念上来说,它非常简单。
So Selection Sort, while it might be easier perhaps to think through than Bubble Sort, or maybe it's pretty much equivalent, it's just a different approach to the same problem.
因此,仔细想想,选择排序也许比,冒泡排序更简单,或者这两者都差不多,只是对同一问题的不同方法而已。
应用推荐