docs: 修改选择排序文档注释

This commit is contained in:
= 2024-05-15 14:18:54 +08:00
parent 6a5396d54d
commit b2c7eeb9ab

View File

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