![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
Frances_fly
这个作者很懒,什么都没留下…
展开
-
oj2087&&kmp
#include <cstdio> #include <string> #include <iostream> using namespace std; void get_nxt(int nxt[], string t) { int i=0; int j=1; nxt[0]=0; while(j<t.size()) { if(t[i]!=t[j]) { if(i==0)原创 2020-12-20 14:00:43 · 107 阅读 · 0 评论 -
树的输入基础部分
1.队列实现 #include <cstdio> #include <queue> #define null NULL using namespace std; //事例:1 2 3 # # 4 # # 5 # # //读取1作为根节点;1 //pop(1);读取2,作为lchild进队列;读取3作为rchild进队列;2 3 //pop(2);遇到#不进入if;遇到#不进入if;3 //pop(3);读取数字4作为lchild;遇到#不进入if;4 //pop(4);遇到#不进入i原创 2020-10-11 17:09:32 · 537 阅读 · 0 评论 -
队列的两种实现形式
链表实现 #include <cstdio> #define null NULL using namespace std; struct node { node* nxt; int val; }; struct queue { node* front; node* rear; queue() { front=rear=null; } void push(int val) { node* x =原创 2020-09-29 21:30:22 · 125 阅读 · 0 评论 -
栈的两种实现形式
栈的链表形式 #include <cstdio> using namespace std; #define null NULL struct node{ node* nxt; int val; }; struct stack{ node* head; int siz;//链表长度 stack() //构造函数,初始化 { head = new node(); siz = 0; void push(int原创 2020-09-29 15:01:12 · 103 阅读 · 0 评论 -
链表基础知识
/*使用链表实现一个学生信息管理系统。要求:学生有名字(string)、平均成绩(double)、学号(string)三个属性。 实现以下函数: ①、插入一条学生信息,并且保证链表有序,成绩高的靠近链表头。 ②、根据名字查询所有同名的学生信息,打印出来 ③、实现查询平均成绩在某一区间内的学生个数 ④、根据学号删除一条学生信息 ⑤、根据学号修改某一个学生的平均成绩,并保持链表有序。(tip:拿出来重新插入一次就可以了))*/ #include <cstdio> #include <原创 2020-09-25 22:44:25 · 88 阅读 · 0 评论