随笔分类 - 数据结构
摘要://二叉树链式存储 #include<stdio.h>#include<math.h> #define ElemType char#define MaxSize 20 typedef struct BiNode{ ElemType data; struct BiNode *lchild,*rchil
阅读全文
摘要://二叉树顺序存储 不存下标0#include<stdio.h>#include<math.h> #define ElemType int#define MaxSize 20typedef struct SqBinTree{ ElemType data; int isEmpty;//我们需要一个东西
阅读全文
摘要://利用程序中缀转后缀#include<stdio.h>#include<stdlib.h> #define ElemType char#define MaxSize 10 typedef struct{ ElemType data[MaxSize]; int top;} SqStack; //初始
阅读全文
摘要://链式队列#include<stdio.h>#include<stdlib.h> #define ElemType int typedef struct LinkNode{//链式队列节点ElemType data;struct LinkNode *next;}LinkNode; typedef
阅读全文
摘要://顺序队列,会有假溢出的缺点#include<stdio.h> #define MaxSize 5#define ElemType int typedef struct node{ElemType data[MaxSize];int front_queue,rear_queue;}SqQueue;
阅读全文
摘要://顺序循环队列,克服假溢出的缺点 #include<stdio.h> #define MaxSize 5#define ElemType int typedef struct node{ElemType data[MaxSize];int front_queue,rear_queue;}SqQue
阅读全文
摘要://链表栈#include<stdio.h>#include<stdlib.h>#define MaxSize 5#define ElemType int typedef struct node{ElemType data;struct node *next;}listStack; //创造头节点l
阅读全文
摘要://共享栈#include<stdio.h> #define MaxSize 5#define ElemType int typedef struct {ElemType data[MaxSize];int top1;int top2;}SqStack; //初始化void initStack(Sq
阅读全文
摘要:#include<stdio.h> #define MaxSize 5#define ElemType int typedef struct {ElemType data[MaxSize];int top;}SqStack; //初始化void initStack(SqStack *S){ S->t
阅读全文
摘要://循环双链表#include<stdio.h>#include<stdlib.h>#define ElemType int typedef struct Node{ElemType data;struct Node *prior,*next;}Node; Node *createHead(){ N
阅读全文
摘要://双链表#include<stdio.h>#include<stdlib.h>#define ElemType int typedef struct Node{ElemType data;struct Node *prior,*next;//双链表 有头尾两个指针}Node; //创造头节点Nod
阅读全文
摘要://头插 尾插 删除 查询 单链表#include<stdio.h>#include<stdlib.h> #define ElemType int typedef struct a{ElemType data;struct a *next;}Node; //创造头节点,本人比较喜欢有头结点的,方便N
阅读全文
摘要:#include<stdio.h>#include<stdlib.h> #define initSize 10 //定义初始大小#define ElemType int typedef struct List{int length,MaxSize;//现在定义的是动态的顺序表,所以设置一个MaxSi
阅读全文
摘要:#include<stdio.h> #define MaxSize 10 //宏定义 替换效果 MaxSize替换为50#define ElemType int //ElemType 替换为 int typedef struct List{int length =10; //可以不设置=10 为了区
阅读全文

浙公网安备 33010602011771号