![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
peer pressure
一往无前虎山行
展开
-
while循环中判断顺序影响
错误如下: #include<bits/stdc++.h> using namespace std; struct node{ char cal;//操作符 char num;//操作数 int flag; //flag==1 为操作数 , flag ==0 为操作符 } ; string str; stack<node> temp;//操作符栈 queue<node> houzhui;//后缀队列 map<char,int> op原创 2020-12-18 14:08:36 · 320 阅读 · 0 评论 -
根据前序与中序遍历序列确定二叉树
# include<iostream> using namespace std; typedef struct BiNode{ int data; struct BiNode *lchild,*rchild; }BiNode,*Bitree; //先序遍历 bool preOrderTraverse(Bitree T){ if(T==NULL) return true; else{ cout<<T->data; preOrderTraverse(T->.原创 2020-10-14 16:22:47 · 448 阅读 · 0 评论 -
青岛大学王卓 数据结构 链队列 c++实现
#include<iostream> using namespace std; typedef struct Qnode{ int data; struct Qnode *next; }Qnode,*Qptr; typedef struct LinkQue{ Qptr front; Qptr rear; }LinkQue; LinkQue initial(){ LinkQue s; s.front = new Qnode; s.front->next = NULL; s..原创 2020-09-18 19:20:36 · 125 阅读 · 0 评论 -
青岛大学 数据结构 链栈 c++实现
#include<iostream> using namespace std; typedef struct StackNode{ int data; struct StackNode *next; }StackNode,*StackList; //头指针就是栈顶,不需要头结点,无溢出,头指针为空则为空栈 StackList initial(){ StackList s = new StackNode; s = NULL; return s; } int push(StackLis.原创 2020-09-18 19:00:33 · 221 阅读 · 0 评论 -
青岛大学王卓 数据结构 顺序队列 c++实现
#include<iostream> using namespace std; typedef struct SqQueue{ int *base;//动态生成数组 int front;//头“指针” int rear; //尾“指针” }sqQueue; int initial(int quequesize,SqQueue &s){ s.base = new int[quequesize]; s.rear = 0; s.front = 0; return 1; .原创 2020-09-18 16:56:41 · 148 阅读 · 0 评论 -
青岛大学王卓数据结构顺序栈的c++实现
#include<iostream> using namespace std; typedef struct SqStack{ int *base; int *top; int stacksize; }SqStack; SqStack initial(int maxsize){ SqStack s; s.base = new int[maxsize]; s.top = s.base; s.stacksize = maxsize; return s; } bool destr.原创 2020-09-18 14:46:20 · 223 阅读 · 0 评论