![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
有点肝的萌新
这个作者很懒,什么都没留下…
展开
-
链表入门
#include<stdio.h> #include<stdlib.h> //创建链表结构体 struct test { int data; struct test *next; }; //打印链表函数 //原理:当链表不为空的时候,依次循环往下遍历,每次遍历的时候打印数据 void shuc(struct test *o) { while(o!=NULL) { printf("%d ",o->data); o=o->next; } printf("\原创 2020-11-04 17:28:33 · 127 阅读 · 0 评论 -
用栈解决最长公共字符串问题
目录 #include<stdio.h> #include<string.h> struct m { char a[100]; int top; }; struct n { char b[100]; int top; }; int main() { struct m z1; struct n z2; int t,max=0,sum=0,x,y; char ...原创 2019-11-03 15:51:26 · 165 阅读 · 0 评论 -
栈,队列的综合应用及讲解
栈与队列的综合应用【栈的定义】【队列定义】【纸牌游戏】 【栈的定义】 栈是限定仅在表尾进行插入和删除操作的线性表,栈的插入就是压栈,栈的删除就是出栈,为后进先出结构,出栈的地方叫做栈顶。 一共有两种栈的存储方式,一种顺序栈,通常由数组实现,另一种链栈,由单链表指针实现,顺序栈选择数组首元素作为栈顶,链栈选择头指针位置作为栈顶。 【队列定义】 1、队列(queue)是只允许在一端进行插入操作,而在另...原创 2019-10-27 13:51:08 · 1298 阅读 · 1 评论