
数据结构基本运算算法
文章平均质量分 55
s零露漙兮
只想默默的编程,有个人在身边陪着我
展开
-
顺序表各种基本运算的算法
sqlist.cpp 源文件代码如下:#include #include #define MaxSize 50typedef int ElemType;typedef struct { ElemType data[MaxSize]; int length; }SqList; void CreateList(SqList *&L,ElemType a[],int原创 2017-10-11 19:45:40 · 2554 阅读 · 0 评论 -
单链表各种基本运算的算法
linklist.cpp中源程序代码:#include #include typedef char ElemType;typedef struct LNode{ ElemType data; struct LNode *next;}LinkNode;void CreateListF(LinkNode *&L,ElemType a[],int n) //头插法建立单链表{ Li原创 2017-10-11 21:18:20 · 2157 阅读 · 0 评论 -
顺序栈各种基本运算的算法
"sqstack.cpp"中源程序代码:#include #include #define MaxSize 100typedef int ElemType;typedef struct{ ElemType data[MaxSize]; int top;}SqStack;void InitStack(SqStack *&s) //初始化栈{ s=(SqStack *)mal原创 2017-10-18 23:16:51 · 3849 阅读 · 0 评论 -
环形队列各种基本运算的算法
#include #include #define MaxSize 100typedef int ElemType;typedef struct{ ElemType data[MaxSize]; int front,rear;} SqQueue;void InitQueue(SqQueue *&q) //初始化队{ q=(SqQueue *)malloc(sizeof(SqQ原创 2017-11-01 20:13:12 · 3535 阅读 · 0 评论 -
二叉树各种基本运算的算法
【代码】#include #include #define MaxSize 100typedef char ElemType;typedef struct node{ ElemType data; //数据元素 struct node *lchild; //指向左孩子节点 struct node *rchild; //指向右孩子节点} BTNode;void Cre原创 2017-11-22 12:36:05 · 3642 阅读 · 2 评论 -
图的邻接矩阵和邻接表存储
【代码】#include #include #define INF 32767 //定义∞#define MAXV 100 //最大顶点个数typedef char InfoType;//以下定义邻接矩阵类型typedef struct{ int no; //顶点编号 InfoType info; //顶点其他信息} VertexType;原创 2017-12-19 08:42:53 · 1918 阅读 · 0 评论