bubble.h
来自「数据结构c++语言描述的源代码」· C头文件 代码 · 共 13 行
H
13 行
#include "swap.h"
#include "max.h"
template<class type>
void SelectionSort(type *a, int n)
{// Sort the n elements a[0:n-1].
for (int size = n; size > 1; size--) {
int j = max(a, size);
swap(a[j], a[size - 1]);}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?