数据结构实验——排序

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <bitset>
#include <stack>
#include <stdlib.h>
using namespace std;
using namespace std;
/*
 输入一组关键字序列分别实现下列排序:
 1.实现简单选择排序、直接插入排序和冒泡排序。
 2.实现希尔排序算法。
 3.实现快速排序算法。
 4.实现堆排序算法。
 */
#define Maxsize 100

typedef int KeyType;
typedef int InfoType;
typedef struct
{
    KeyType key;
    InfoType info;
}Type;
typedef struct
{
    Type r[Maxsize+1];
    int len;
}Sqlist;
int data[Maxsize];
void Create(Sqlist &L,int n)
{
    L.len = n;
    for(int i=1;i<=n;i++)
    {
        cin>>L.r[i].key;
        L.r[i].info = 0;
    }
}
void Print(Sqlist L)
{
    cout&l
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值