![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 63
只爱艾薇儿
这个作者很懒,什么都没留下…
展开
-
链队列
#include #include#define Error 1#define Ok 0typedef int Status;typedef int QElemType;typedef struct QNode { QElemType data; struct QNode *next;}QNode,*QueuePtr; //链队列的节点原创 2012-11-26 08:54:20 · 462 阅读 · 0 评论 -
排序算法-------2-路插入排序
#include#include#define Status int #define max 20typedef struct { Status key;}ElemType;typedef struct { ElemType r[max]; int length;}Sqlist;void Inital(Sqlist &L) //初始化{ L.r[1].key原创 2013-01-04 12:28:43 · 624 阅读 · 0 评论 -
排序算法------快速排序
#include#include#define Status int #define max 20typedef struct { Status key;}ElemType;typedef struct { ElemType r[max]; int length;}Sqlist;void Inital(Sqlist &L) //初始化{ L.r[1].k原创 2013-01-05 11:45:13 · 358 阅读 · 0 评论 -
排序算法-------堆排序(大根堆)
#include#include#define Status int #define max 20typedef struct { Status key;}ElemType;typedef struct { ElemType r[max]; int length;}Sqlist;void Inital(Sqlist &L)//初始化{ L.r[1].key=原创 2013-01-05 10:44:24 · 700 阅读 · 1 评论 -
排序算法-------直接选择排序
#include#include#define Status int #define max 20typedef struct { Status key;}ElemType;typedef struct { ElemType r[max]; int length;}Sqlist;void Inital(Sqlist &L) //初始化{ L.r[1].key原创 2013-01-05 10:23:53 · 549 阅读 · 0 评论 -
排序算法------归并排序
#include#include#define Status int #define max 20typedef struct { Status key;}ElemType;typedef struct { ElemType r[max]; int length;}Sqlist;void Inital(Sqlist &L) //初始化{ L.r[1].key原创 2013-01-06 10:02:57 · 270 阅读 · 0 评论 -
排序算法-----基数排序
#include#include#define MAX_NUM_KEY 8#define PADIX 10#define MAX_SPACE 12typedef struct{ int key[MAX_NUM_KEY];//关键字------但是这个我却没有用到 int otheritems; //其他项 也就是具体的数 int next; //指向静态链表的下一项原创 2013-01-06 11:38:21 · 397 阅读 · 0 评论 -
查找树-----顺序查找
#include#include#define ElemType int #define KeyType int #define max 20typedef struct { ElemType *elem; int length;}SStable; //顺序查找的结构体,一个指针elem指向一个数组void creat(SStable &st)//原创 2013-01-08 15:46:06 · 444 阅读 · 0 评论 -
查找树-------二分查找
#include#include#define ElemType int #define KeyType int #define max 20typedef struct { ElemType *elem; int length;}SStable;//以顺序表作为基础的折半查找void creat(SStable &st)//初始原创 2013-01-08 15:55:56 · 392 阅读 · 0 评论 -
查找树-------二叉排序树
#include #include#define Ok 1#define Error 0#define max 20#define Status int typedef struct Btree{ Btree *lchild; Btree *rchild; int data;}Btree,*Bitree; //二叉排序树的结构体,和普通二叉树节点的结构一样Btree原创 2013-01-08 17:09:45 · 335 阅读 · 0 评论 -
查找树-----平衡二叉树
#include #include#define Ok 1#define Error 0#define max 20#define Status int #define LH 1#define EH 0#define RH -1typedef struct Btree{ Btree *lchild; Btree *rchild; int data; int bf原创 2013-01-09 11:41:23 · 475 阅读 · 0 评论 -
图算法-----图的邻接矩阵表示法(数组表示法)
#include #include#define MAX_VERTEX_NUM 20#define Ok 1#define Error 0typedef int VRTYPE;typedef int VertexType;typedef int Adjmatrix;typedef int Status;typedef struct ArcCell{ VRTYPE adj;原创 2013-01-13 16:08:06 · 1933 阅读 · 0 评论 -
图算法------图的邻接表表示法(图的链式存储)
#include#include#define Ok 1#define Error 0#define MAX 20typedef int Status ;typedef char VertexType ;typedef struct ArcNode{ int adjvex; struct ArcNode *nextarc; //指向下一个弧的指针原创 2013-01-13 16:28:30 · 810 阅读 · 0 评论 -
排序算法----直接插入排序
#include#include#define Status int #define max 20typedef struct { Status key;}ElemType;typedef struct { ElemType r[max]; int length;}Sqlist; //定义直接插入排序的数组的结构体void Inital(Sqlist &原创 2013-01-04 10:31:24 · 474 阅读 · 0 评论 -
排序算法------折半插入排序
#include#include#define Status int #define max 20typedef struct { Status key;}ElemType;typedef struct { ElemType r[max]; int length;}Sqlist; //结构体的定义void Inital(Sqlist &L) //初始化原创 2013-01-04 11:49:45 · 523 阅读 · 0 评论 -
循环队列
#include #include #define Error 1#define Ok 0#define MAXSIZE 6typedef int Status;typedef int QElemType;typedef struct SqQueue{ QElemType *base; int front ; int rear;}SqQueue;原创 2012-11-26 08:59:18 · 443 阅读 · 0 评论 -
串的堆分配表示
#include #include#define Error 0#define Ok 1typedef int Status;typedef struct { char *ch; int length;}HString; //堆分配的结构体定义Status StrAssign(HString &T,char *chars){ //生成一个值等原创 2012-11-26 09:05:04 · 382 阅读 · 0 评论 -
串的顺序存储表示
#include #include#define Error 0#define Ok 1#define MAXSIZE 256typedef int Status;typedef struct { char str[MAXSIZE]; int length;}SqString; //定义串的结构体,用一个数组存储串Status StrAssign(SqSt原创 2012-11-26 09:02:06 · 701 阅读 · 0 评论 -
数据结构线性表之顺序表
#include#include#define Ini_length 100#define List_liength 10 #define Error 0#define Ok 1typedef int EmleType;typedef int Status ;typedef struct Sqllist原创 2012-11-13 22:38:54 · 447 阅读 · 0 评论 -
一元多次多项式的四则运算
#include #include#define Error 1#define Ok 0typedef int Status;typedef int ElemType;typedef struct term{ float coef; int expn; struct term *next;}term,*Linklist;原创 2012-11-17 13:13:41 · 2056 阅读 · 2 评论 -
线性表之链表
#include #include#define LIST_SIZE 100#define Error 0#define Ok 1typedef int Status;typedef int ElemType ;typedef struct LNode { ElemType data; struct LNode *next;}LNode,*Link原创 2012-11-17 11:51:56 · 371 阅读 · 0 评论 -
线性表之双向链表
#include #include #define Error 0#define Ok 1typedef int Status;typedef int ElemType;typedef struct DuLNode{ ElemType data; struct DuLNode *prior; struct DuLNode *next;}D原创 2012-11-17 12:45:33 · 587 阅读 · 0 评论 -
顺序栈
#include #include#define STACK_INIT_SIZE 100#define STACKINCREMENT 10#define Ok 1#define Error 0typedef int SElemType;typedef int Status;typedef struct{ SElemType *base; SElemType *原创 2012-11-20 21:55:22 · 487 阅读 · 1 评论 -
链式栈
#include #include#define Ok 1#define Error 0typedef int Status;typedef int ElemType;typedef struct LNoelist { ElemType data; struct LNoelist *next;}LNoelist; //链栈每个节点的结构体原创 2012-11-20 21:58:03 · 397 阅读 · 0 评论 -
顺序队列
#include #include#define STACK_INIT_SIZE 100#define STACKINCREMENT 10#define Ok 1#define Error 0typedef int QElemType;typedef int Status;typedef struct { QElemType *front; QElemType *rea原创 2012-11-26 08:51:12 · 315 阅读 · 0 评论 -
递归算法先序遍历二叉树
#include #include#define Ok 1#define Error 0typedef int Status;typedef int TElemType ;typedef struct BiTNode{ TElemType data; struct BiTNode *lchild,*rchild;}BiTNode,*BiTree; /原创 2012-12-28 16:03:16 · 1112 阅读 · 0 评论 -
串的模式匹配(普通算法)
#include #include#include#define Error 0#define Ok 1#define MAXSIZE 256typedef int Status;typedef struct { char str[MAXSIZE]; int length;}SqString; //使用串的顺序存储表示来存储串Status StrAssign原创 2012-12-28 15:57:45 · 414 阅读 · 0 评论 -
图算法-----图的十字链表表示法
#include#include#define MAX_VERTEX_NUM 20typedef int Status;typedef struct ArcBox{ int tailvex,headvex;//该弧的尾和头的顶点的位置 struct ArcBox *hlink,*tlink; //指向弧头相同和弧尾相同节点的指针}ArcBox; //用来存储弧信息的各原创 2013-01-13 16:53:49 · 1250 阅读 · 0 评论