- 博客(5)
- 收藏
- 关注
原创 图的遍历——创建图
以下代码基于王道数据结构: #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <string.h> #define MAX 100 #define isLetter(a) ((((a)>='a')&&((a)<='z')) || (((a)>='A')&&((a)<='Z'))) #define LENGTH(a).
2021-11-05 18:27:28 78
原创 线索二叉树
基于王道数据结构: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef char ElemType; typedef struct ThreadNode{ ElemType data; struct ThreadNode *lchild,*rchild; int ltag,rtag; }ThreadNode,*ThreadTree; //手工建线索树,总计5个结点...
2021-10-29 14:53:08 75
原创 二叉树的遍历
以下代码基于王道操作系统: #include "function.h" //递归实现 //abdhiejcfg void preOrder(BiTree p) { if(p!=NULL) { putchar(p->c);//等价于visit函数 preOrder(p->lchild); preOrder(p->rchild); } } //中序遍历 hdibjeafcg void InOrder(BiTree p...
2021-10-23 12:34:20 103 1
原创 基于C语言的栈
基于王道数据结构: #include <stdio.h> #include <stdlib.h> #define MaxSize 50 typedef int ElemType; typedef struct{ ElemType data[MaxSize];//数组 int top; }SqStack; void InitStack(SqStack &S) { S.top=-1;//代表栈为空 } bool StackEmpty(SqStack ...
2021-10-19 14:27:16 59
原创 用C语言编写顺序表的增删查
顺序表的增删查,基于王道数据结构: #include <stdio.h> #include <stdlib.h> #define MaxSize 50 typedef int ElemType; //静态分配 typedef struct{ ElemType data[MaxSize]; int length; }SqList; //动态分配 #define InitSize 100 typedef struct{ ElemType *da...
2021-09-25 16:58:16 240
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人