简单选择排序(Simple Selection Sort)的核心思想是每次选择无序序列最小的数放在有序序列最后
演示实例:
C语言实现(编译器Dev-c++5.4.0,源代码后缀.cpp)
原创文章,转载请注明来自钢铁侠Mac博客http://www.cnblogs.com/gangtiexia
#include
#define LEN 6
typedef float keyType;
typedef struct{
keyType score;
char name[];
}student;
typedef struct{
int length=LEN;
student stu[LEN];
}sqList;
int selectMax(sqList &L,int i){
int max;
keyType maxScore=L.stu[i].score;
for(max=i;i
if(maxScore
max=i;
return max;
}
void simpleSS(sqList &L){
int max;
for(int i=;i
{