跳至主要內容
选择排序 Selection sort

选择排序 Selection sort

原理

先看看Wikipedia的定义:

The Selection sort algorithm divides the input list into two parts: the sublist of items already sorted and the sublist of items remaining to be sorted that occupy the rest of the list. Initially, the sorted sublist is empty and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest element in the unsorted sublist, exchanging it with the leftmost unsorted element, and moving the sublist boundaries one element to the right. .


莫林...大约 3 分钟数据结构与算法选择排序排序Javascript