头文件:
/*基数排序,单链表实现*/
#ifndef RADIX_SORT_H
#define RADIX_SORT_H
#include <stdbool.h>
#define FLOWOVER -1
#define LIST_EMPTY -2
struct RadixSort;
typedef struct RadixSort * List;
typedef struct RadixSort * Node;
typedef int Element;
struct RadixSort
{
Element elem;
Node next;
};
List CreateList(void);//创建空表,返回表头地址
bool IsLast(Node N);//检测输入节点是否为表尾,是返回true
bool IsEmpty(List L);//检测输入表是否为空,是返回true
List DestroyList(List L);//删除表并释放内存
void AddNode(List L, Element e);//在表尾加入数据域为e的节点
void MoveNode(List L1, List L2);//将表L2中的头节点移动成为L1的尾节点
void PrintList(List L);//从第一个节点开始输出表中数据
#endif
实现文件:
#include <stdlib.h>
#include <malloc.h>
#include <stdio.h>
#include "radix_sort.h"
List CreateList(voi