diff --git a/sort/select-sort.mjs b/sort/select-sort.mjs index 3dbb47f..c0c3c62 100644 --- a/sort/select-sort.mjs +++ b/sort/select-sort.mjs @@ -2,8 +2,8 @@ import { swap } from '../util/index.mjs'; /** * - * @param {number[]} arr - * @description 朴素的冒泡排序 + * @param {number[]} arr - 需要排序的数组 + * @description 普通的选择排序 */ export function selectSort(arr) { const len = arr.length; @@ -60,3 +60,8 @@ export function selectSort2(arr) { // 实际比较下来优化后的选择排序也没太大作用(实际开发不应使用这种排序,主要学习其解决思路) export default selectSort; + + +let arr = [3,4,2,3,2,6,4,3] +selectSort2(arr) +console.log(arr);