数据结构
Violetfh
临镜画眉,红衣轻拭泪痕脂香。花轿已到门前,盖上红帕,想到那离别时你那真挚的承诺:“明年桃花满枝时,我会回来找你。”又想到你被任用时的那绽开的笑颜,是我从不曾相见的 嫁于高官换仕途,换你开颜 ,即使你不知亦无悔。
展开
-
数据结构-bf
#include <iostream>#include <fstream>#include <cstring>using namespace std;#define error 0#define ok 1int bf(string s, string t, int pos){ int i = pos; int j = 0; int lens = s.length(); int lent = t.length(); while (i <= l原创 2021-12-12 16:38:02 · 431 阅读 · 1 评论 -
数据结构-链队列
#include <iostream>#include <fstream>using namespace std;#define ok 1#define error 0typedef struct qnode { char data; struct qnode *next;} qnode, *queen;typedef struct { queen front;//队头指针 queen reer;//队尾指针} linkqueen;//初始化in原创 2021-12-12 13:30:37 · 643 阅读 · 0 评论 -
数据结构-循环队列
在顺序队列中,当队尾指针已经到数组的上界,不能再有入队操作,但其实数组中还有空位置,这就叫做“假溢出”,解决假溢出的途径---- 采用循环队列。 #include <iostream>#include <fstream>using namespace std;#define max 100#define ok 1#define error 0typedef struct { int *base; int front; int rear;} squeel;.原创 2021-12-11 10:44:19 · 286 阅读 · 0 评论 -
数据结构-链栈
#include <bits/stdc++.h>using namespace std;typedef struct wjb { int data; struct wjb *next;} wjb, *Linkstack;/*栈的初始化*/Linkstack Initstack(Linkstack s) { s = NULL; //栈顶指向NULL return s;}/*压栈*/Linkstack Push(Linkstack s, int e) { wjb原创 2021-12-08 01:23:00 · 61 阅读 · 0 评论 -
数据结构-顺序栈
#include <bits/stdc++.h>using namespace std;#define max 100#define ok 1#define error 0//顺序栈的存储结构typedef struct { int *base; int *top; int stacksize; //可用最大容量} SqStack;//初始化void InitStack(SqStack &S) { S.base = new int[max]; S.原创 2021-12-07 16:38:19 · 634 阅读 · 0 评论 -
数据结构-链表-课堂管理系统
#include <iostream>#include <string>using namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2typedef struct LNode { //单链表的存储结构 string no; string name; int jyz; //结点的数据域 struct LNode *next; //结点的指针域} LNode, *Linklist;原创 2021-12-06 23:57:22 · 299 阅读 · 1 评论 -
数据结构-一元多项式的创建和相加
//一元多项式的创建和相加#include <bits/stdc++.h>using namespace std;#define ok 1#define error 0typedef struct dnode { int xishu;//系数 int zhishu;//指数 struct dnode *next;} dnode, *dlist;//多项式的创建void chuangjian(dlist &p, int m) { dnode *q, *pre,原创 2021-12-02 22:14:02 · 1048 阅读 · 0 评论 -
数据结构-链表的合并
#include <iostream>using namespace std;typedef struct node { int data; struct node *next;} node, *list;void chuangjian(list &l) { //创建链表 l = new node; l->next = NULL;}void shuru(list &l, int n) { //链表数据的输入 int i; node *p,原创 2021-11-30 23:49:49 · 952 阅读 · 0 评论 -
数据结构-顺序表的合并
//顺序表的长度,取第i个元素,判断有无e这个元素,把e插到最后,输出表,合并表#include <iostream>using namespace std;#define max 100#define ok 1#define error 0typedef struct { int *elem; int length;} list;void chuangianshunxubiao(list &l)//创建单链表 { l.elem = new int[max]原创 2021-11-27 23:02:25 · 1936 阅读 · 0 评论 -
数据结构-双向链表(出错了,改好了)
出了点问题//双向链表的插入,创建,删除,长度。#include <bits/stdc++.h>using namespace std;#define ok 1#define error 0typedef struct dnode { int data; struct dnode *last; struct dnode *next;} dnode, *lilinst;int chushihua(lilinst &l) { l = new dnode; l原创 2021-11-08 23:14:51 · 102 阅读 · 3 评论 -
数据结构-线性表-单链表
单链表的初始化,查找,插入,删除,创建//单链表的初始化,查找,插入,删除,创建#include <bits/stdc++.h>using namespace std;#define ok 1#define error 0#define overflow -2typedef struct fgh { int data; struct fgh *next;} fgh, *yhf;int chushihua(yhf &l) { //初始化 l = new fg原创 2021-10-30 17:02:43 · 43 阅读 · 0 评论 -
数据结构-线性表-顺序表
#include <bits/stdc++.h>using namespace std;typedef int State;typedef int ElemType;typedef struct Node { //结点的存储结构 ElemType data; //结点的数据部分 struct Node *next; //指向结点的下一结点} Node;typedef struct Node *LinkList; //定义LinkList(其实也就是头结点)/原创 2021-10-15 21:45:41 · 65 阅读 · 1 评论