![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
数据结构
数据结构
我在干饭
这个作者很懒,什么都没留下…
展开
-
串构建与操作
串 #include<stdio.h> #include<stdlib.h> #define MAX 250 typedef struct{ char data[MAX]; int length; } defstring; //获取字符串长度 int getlen(char str[]){ int i=0; while(str[i]) i ++; return i; } //初始化 int init_str(defstring *S,char str[]){原创 2021-06-08 08:05:37 · 188 阅读 · 0 评论 -
队列构建与操作
队列 #include<stdio.h> #include<stdlib.h> #include<time.h> #define max_size 10 //集合 typedef struct table{ int *a; int length; } table; //初始化 void initTable(table *U){ U->a = (int *)malloc(sizeof(int) * max_size); U->length = 0;原创 2021-06-08 08:05:08 · 142 阅读 · 0 评论 -
栈与队列-判断回文
判断回文(队列和栈综合运用) #include<stdio.h> #include<stdlib.h> #define MAX 250 //定义栈数据类型 typedef struct stack{ int *a; int top; } stack; //定义队列 typedef struct opt{ int *b; int length; } opt; //获取字符串长度 int getlen(char data[]){ int i=0; while(data[原创 2021-06-08 08:04:35 · 1010 阅读 · 3 评论 -
数组-矩阵
数组-二维数组生成 #include<stdio.h> #include<stdlib.h> #include<time.h> #define max 250 //动态分配数组空间 int **getarry(int row,int col){ int **arr; arr = (int **)malloc(row * sizeof(int *)); for(int i=0;i<row;i++) arr[i] = (int *)malloc(col *原创 2021-06-08 08:04:04 · 132 阅读 · 0 评论 -
数据结构-栈构建与操作
顺序栈 #include<stdio.h> #include<stdlib.h> #define max_size 10 //抽象数据类型 typedef struct stack{ int *a; int top; } stack; //判空 int Empty(stack *L){ return (L->top == -1); } //判满 int Full(stack *L){ return (L->top == max_size); } /原创 2021-06-08 08:03:45 · 126 阅读 · 0 评论 -
C链表应用 综合
链表 双链表 #include<stdio.h> #include<stdlib.h> //定义数据类型 typedef struct Dlink{ int elem; struct Dlink *ahead; struct Dlink *next; } dlink; //生成双链表函数 dlink *initDlink(){ dlink *p = (dlink*)malloc(sizeof(dlink)); dlink *temp = p; p->ahead原创 2021-04-13 11:11:10 · 77 阅读 · 0 评论