sky068 / gitalk

gitalk comments, hexo+gitalk 评论
0 stars 0 forks source link

经典排序算法之直接选择排序 | SkyXU's blog #21

Open sky068 opened 5 years ago

sky068 commented 5 years ago

https://xujiawei.net/2019/02/21/%E7%BB%8F%E5%85%B8%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95%E4%B9%8B%E7%9B%B4%E6%8E%A5%E9%80%89%E6%8B%A9%E6%8E%92%E5%BA%8F/

直接选择算法和冒泡有异曲同工之妙。 12345678910111213141516function sortSelect(arr) { for (let i = 0; i < arr.length; i++) { let index = i; for (let j = i+1; j < arr.length; j++) {