
栈和队列_《数据结构》
栈和队列的基本操作
笑着找bug
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C - 数据结构实验之栈与队列三:后缀式求值
Description 对于一个基于二元运算符的后缀表示式(基本操作数都是一位正整数),求其代表的算术表达式的值。 Input 输入一个算术表达式的后缀式字符串,以‘#’作为结束标志。 Output 求该后缀式所对应的算术表达式的值,并输出之。 Sample Input 59684/-3+# Output 57 Hint 基本操作数都是一位正整数! #include <iostream> using namespace std; int s[100005]; int cnt; void p原创 2020-11-19 16:03:58 · 148 阅读 · 0 评论 -
数据结构实验之栈与队列二:一般算术表达式转换成后缀式
Description 对于一个基于二元运算符的算术表达式,转换为对应的后缀式,并输出之。 Input 输入一个算术表达式,以‘#’字符作为结束标志。 Output 输出该表达式转换所得到的后缀式。 Sample Input a*b+(c-d/e)*f# Output abcde/-f+ #include <iostream> #include <bits/stdc++.h> using namespace std; char s[1005]; int cnt; void pu原创 2020-11-18 11:04:30 · 174 阅读 · 0 评论 -
数据结构实验之栈与队列一:进制转换
Description 输入一个十进制非负整数,将其转换成对应的 R (2 <= R <= 9) 进制数,并输出。 Input 第一行输入需要转换的十进制非负整数; 第二行输入 R。 Output 输出转换所得的 R 进制数。 Sample Input 1279 8 Output 2377 #include <iostream> #include <bits/stdc++.h> using namespace std; int s[1005]; int cnt; v原创 2020-11-18 11:03:17 · 480 阅读 · 0 评论