jinloongChen / jinloongChen.github.io

0 stars 0 forks source link

Selectsort | 龙龙的小站 #1

Open jinloongChen opened 2 hours ago

jinloongChen commented 2 hours ago

https://jinloongchen.github.io/posts/3ce50156.html?

每次选择未排序最小值(选择下标)与待排序第一个值交换 12345678910111213void selectSort(vector& nums) { for (int i = 0; i < nums.size(); i++) {//外层循环控制循环次数 int minIndex = i;//minIndex为未排序最小值下标 for

jinloongChen commented 2 hours ago

开启评论功能!