(七十二)第 10 章 内部排序(基数排序)
示例代码
radixSort.h
// 基数排序实现头文件
#ifndef RADIX_SORT_H
#define RADIX_SORT_H
#include "errorRecord.h"
#define MAX_KEY_ITEM_NUM 8
#define RADIX 10
#define MAX_SPACE 1000
#define NUM 10
typedef char KeysType;
typedef int InfoType;
typedef int KeyType;
typedef struct {
KeyType key;
InfoType otherInfo;
} RecType;
typedef struct {
KeysType keys[MAX_KEY_ITEM_NUM];
InfoType otherItem;
int next;
} SLNode;
typedef struct {
SLNode rec[MAX_SPACE];
int keyNum;
int recNum;
} SLList;
typedef int ArrType[RADIX];
/*
前置条件:list 非空
操作结果:初始化 list
*/
Status InitList(int n, RecType rec[], SLList *list);
/*
算法 10.17
前置条件:list 非空
操作结果&