#include <bits/stdc++.h>
using namespace std;
/*
输入一组关键字序列分别实现下列排序:
1.实现简单选择排序、直接插入排序和冒泡排序。
2.实现希尔排序算法。
3.实现快速排序算法。
4.实现堆排序算法。
*/
#define Maxsize 100
using namespace std;
typedef int KeyType;
typedef int InfoType;
typedef struct
{
KeyType key;
InfoType otherinfo;
} RedType;
typedef struct
{
RedType r[Maxsize+1];
int length;
} SqList;
int dlta[Maxsize];
void Create(SqList &L)
{
cout<<"Please Input the Length of List:"<<endl;
scanf("%d",&L.length);
cout<<"Please Input the Data of the List:"<<endl;
for(int i=1; i<=L.length; i++)
{
scanf("%d",&L.r[i].key);
L.r[i].otherinfo=0;
}
}
void Output(SqList L)
{
cout<<"The List Is:"<<endl;
for(int i=1; i<=L.length; i++)
{
cout<<L.r[i].key<<" ";
}
c
数据结构排序算法
最新推荐文章于 2022-08-20 18:02:03 发布