C++实现选择排序(selectionSort)

时间:2021-01-20 02:03:50
【文件属性】:
文件名称:C++实现选择排序(selectionSort)
文件大小:52KB
文件格式:PDF
更新时间:2021-01-20 02:03:50
c ec io 本文实例为大家分享了C++实现选择排序的具体代码,供大家参考,具体内容如下 一、思路 每次取剩下没排序的数中的最小数,然后,填到对应位置。(可以使用a[0]位置作为暂存单元) 如下: 二、实现程序 #include using namespace std; const int maxSize = 100; template void SelectSort(T arr[], int n); // 选择排序 int main(int argc, const char * argv[]) { int i, n, arr[maxSize]; cout <

网友评论