![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
℃、Z
这个作者很懒,什么都没留下…
展开
-
二叉树的中序线索化
#include <stdio.h> #include<stdlib.h> #define max 100 typedef struct Tree{ int data; struct Tree *lchild; struct Tree *rchild; int ltag,rtag; } *tree,sree; typedef struct node{ tree data[max]; int top; }*list,List; lis.原创 2022-04-08 18:19:55 · 389 阅读 · 0 评论 -
二叉树的层次遍历(非递归)
#include<stdio.h> #include<stdlib.h> #define max 100 typedef struct Tree { char data; struct Tree *lchild; struct Tree *rchild; int ltag,rtag; }*tree ,Tree; typedef struct queue{ tree data[max]; int fount,real; }*queue.原创 2022-04-02 00:41:03 · 1018 阅读 · 0 评论 -
二叉树的先、中、后序遍历(非递归)
#include<stdio.h> #include<stdlib.h> #define max 100 typedef struct node{ int data; struct node *lchild; struct node *rchild; }*btree,tree; typedef struct list{ btree data[max]; int top; }*node,Node; node Init(){ node n.原创 2022-04-02 00:40:06 · 644 阅读 · 0 评论 -
KMP算法
#include<stdio.h> #include<stdlib.h> void Insert(String1 s,char *data){ if(s->data){ free(s->data); } int len=0; char * temp=data; while (*temp) { len++; temp++; } if(len==0){ s.原创 2022-04-02 00:38:34 · 96 阅读 · 0 评论 -
字符串暴力匹配
#include<stdio.h> #include<stdlib.h> typedef struct string{ int len; char *data; }*String1,string1; String1 init(){ String1 s=(String1)malloc(sizeof (string1)); if(s){ s->len=0; s->data=NULL; } ret.原创 2022-04-02 00:37:44 · 59 阅读 · 0 评论 -
链式队列(基本功能)
#include<stdio.h> #include<stdlib.h> typedef struct node{ int data; struct node *next; }*node,pnode; typedef struct queue{ node fount; node real; }*queue,squeu; queue init(){ queue s =(queue)malloc(sizeof (squeu)); if(.原创 2022-04-02 00:36:46 · 49 阅读 · 0 评论 -
线性队列(基本功能)
#include <stdio.h> #include<stdlib.h> #define max 100 typedef struct queue{ int data[max]; int fount,real; }*squeue,queue; squeue init(){ squeue s=(squeue)malloc(sizeof (queue)); if(s){ s->fount=0; s->real.原创 2022-04-02 00:35:34 · 58 阅读 · 0 评论 -
链栈(非顺序栈)
#include<stdio.h> #include<stdlib.h> typedef struct node{ int data; struct node *next; }*sqlist,list; typedef struct stack{ sqlist top; }*pstack,stack; pstack init(){ pstack s=(pstack)malloc(sizeof (stack)); if(s) .原创 2022-04-02 00:34:29 · 215 阅读 · 0 评论 -
顺序栈(非链式栈)
#include <stdio.h> #include<stdlib.h> #define max 100 typedef struct stack{ int top; int data[max]; }*pstack,stack; pstack init(){ pstack s=(pstack)malloc(sizeof (stack)); if(s) s->top=-1; return s; } void push(p.原创 2022-04-02 00:33:14 · 42 阅读 · 0 评论 -
单链表(链式)
#include<stdio.h> #include<stdlib.h> typedef struct Node { int data; struct Node *next; }*pnode,node; pnode init(void) { pnode H=(pnode)malloc(sizeof (node)); if(H){ H->data=0; H->next=NULL; } retur.原创 2022-04-02 00:31:18 · 916 阅读 · 0 评论 -
数据结构(顺序表)
#include <stdio.h> #include<stdlib.h> #define MAX 100 typedef struct List { int length; int data[MAX]; }*Lists,list; Lists init() { Lists H=(Lists)malloc(sizeof (list)); if(H) H->length=0; return H; } void Insert(Li.原创 2022-04-02 00:29:07 · 207 阅读 · 0 评论