![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构栈和队列
夜雨时’
好好学习进大厂
展开
-
数据结构---栈的表达式求解
#include<iostream> using namespace std; #define MAXSIZE 100 typedef struct { char *base; char *top; int size; }Stack; typedef struct { int *base; int *top; int size; }Stack1; bool creatStack(Stack &S) { S.base=new char[MAXSIZE]; if(!S.原创 2021-10-06 19:14:49 · 183 阅读 · 0 评论 -
数据结构-----------舞伴问题
#include<iostream> #define MAXSIZE 20 using namespace std; typedef struct { char name[20]; char sex; }Person; typedef struct { Person *base; int front; int rear; }Queue; void creatQueue(Queue &Q) { Q.base=new Person[MAXSIZE]; Q.front=Q.r.原创 2021-10-05 23:19:27 · 404 阅读 · 1 评论 -
数据结构栈和队列-------------链队列的相关的操作
#include<iostream> using namespace std; typedef struct Node { int data; struct Node *next; }QNode; typedef struct { QNode *front; QNode *rear; }LinkQueue; void creatQueue(LinkQueue &Q) { Q.front=Q.rear=new QNode; Q.front->next=NULL;.原创 2021-10-02 23:30:55 · 63 阅读 · 0 评论 -
数据结构栈和队列--------------顺序队列的相关操作
#include<iostream> #define MAXSIZE 6 using namespace std; typedef struct { int *base; int rear; int front; }Queue; void InitQueue(Queue &Q) { Q.base=new int[MAXSIZE]; Q.front=0; Q.rear=0; return; } int lengthQueue(Queue Q) { return(Q.原创 2021-09-29 23:06:51 · 70 阅读 · 0 评论 -
数据结构--------------顺序栈和链表栈相关操作
#include<iostream> #define MAXSIZE 100 using namespace std; typedef struct { int *base; int *top; int stacksize; }Stack; bool InitStack(Stack &S) { S.base=new int[MAXSIZE]; if(!S.base) return false; S.top=S.base; S.stacksize=MAXSIZE;.原创 2021-09-28 19:24:40 · 66 阅读 · 0 评论