![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
yi把菜刀
菜狗一枚,多多包涵
展开
-
南邮实验4(1~4题综合)各种排序算法和时间的计算
运行结果 源文件 #include"堆排序的堆栈.h" //简单排序法 //在startIndex至表尾范围内找到最小关键字的下标元素 int FindMin(List list, int startIndex) { int i, minIndex = startIndex; for (i = startIndex+1; i < list.n; i++) { if (list.D[i].key < list.D[minIndex].key) { minIndex =原创 2021-05-10 18:50:15 · 1822 阅读 · 7 评论 -
数据结构实验3--图以邻接表为存储结构的初始化,遍历,迪杰斯特拉算法求最短路径(实验内容3~4~5)
运行结果: 源文件: #include "邻接表宽度优先遍历的queue.h" //邻接表的初始化 Status Init(LGraph* lg, int nSize) { int i; lg->numofDot = nSize; lg->numofEdge = 0; lg->a = (ENode**)malloc(nSize * sizeof(ENode*)); if (!lg->a) { return ERROR; } else { for (i =原创 2021-04-28 12:28:09 · 525 阅读 · 1 评论 -
数据结构实验3--图以邻接矩阵为存储结构的初始化,遍历,迪杰斯特拉算法求最短路径(实验内容1~2,5)
运行结果: 源文件: #include "邻接矩阵宽度优先遍历的queue.h" //邻接矩阵的初始化 Status Init(MGraph* mg, int nSize, ElemType noEdgeValue) { int i, j; mg->numofDot = nSize; mg->numofEdg = 0; mg->noEdge = noEdgeValue; mg->a = (ElemType**)malloc(nSize * sizeof(ElemType原创 2021-04-28 12:24:10 · 634 阅读 · 0 评论 -
二叉树的先序创建递归遍历和非递归遍历和求叶子结点和树的高度等操作c语言
效果图如下 下面为内容: 源文件: #include "层次遍历的Queue.h" #include "非递归算法的堆栈.h" void Create(BinaryTree* bt) //构造一棵空的二叉树 { bt->root = NULL; } BTNode* NewNode(ElemType x, BTNode* ln, BTNode* rn) //创造一个新的节点 { BTNode* p = (BTNode*)malloc(sizeof(BTNode)); p->e原创 2021-04-11 22:17:14 · 447 阅读 · 0 评论 -
哈夫曼树的创建和编码和译码和压缩(根据编码文件进行译码),压缩等操作c语言
源文件: #include "优先权队列.h" #include "哈夫曼的stack.h" //构造一棵空的二叉树 void Create(BinaryTree* bt) { bt->root = NULL; } HFMTNode* NewBTNode(ElemType w, HFMTNode* lC, HFMTNode* rC) { HFMTNode* p = (HFMTNode*)malloc(sizeof(HFMTNode)); p->w = w; p->lChil原创 2021-04-11 20:45:27 · 2152 阅读 · 8 评论 -
带表头节点一元多项式的初始化,撤销,相加和相乘操作代码实现c语言
有需求者可自提 #include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct Node { int coef; int exp; struct Node* next; }Node,*LinkList; typedef struct Head { LinkList head; }Head; void Insert(LinkList Head, int coef, int exp) //原创 2021-03-15 13:54:06 · 904 阅读 · 3 评论 -
数据结构链表初始化,插入或删除某节点,逆置,按升降序排序等c语言
有需求者可自提代码 #include<stdio.h> #include<stdlib.h> #include<string.h> #define ERROR 0 #define OK 1 #define Overflow 2 #define Underflow 3 #define NotProsent 4 #define Duplicate 5 typedef int ElemType; typedef struct seqList { int n; int ma原创 2021-03-15 13:48:56 · 185 阅读 · 0 评论 -
数据结构顺序表的初始化,删除,增加元素等操作c语言
我们学校实验之一,对你有用可自提 #include<stdio.h> #include<stdlib.h> #include<string.h> #define ERROR 0 #define OK 1 #define Overflow 2 #define Underflow 3 #define NotProsent 4 #define Duplicate 5 typedef int ElemType; typedef struct seqList { int n;原创 2021-03-15 13:44:50 · 437 阅读 · 1 评论