![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构教材代码
花雨就是花雨
最好的我还未等到~
展开
-
SDUT2132--一般算术表达式转换成后缀式
Problem Description 对于一个基于二元运算符的算术表达式,转换为对应的后缀式,并输出之。input 输入一个算术表达式,以‘#’字符作为结束标志。Output 输出该表达式转换所得到的后缀式。Example Input a*b+(c-d/e)*f#Example Output ab*cde/-f*+思路 栈的基本运算。 两个栈,一个存放运算符,另一原创 2017-09-15 13:16:11 · 659 阅读 · 0 评论 -
顺序表基本运算算法
//顺序表基本运算算法#include <stdio.h>#include <malloc.h>#define MaxSize 50typedef int ElemType; typedef struct { ElemType data[MaxSize]; //存放顺序表元素 int length; //存放顺序表的长度} SqLis原创 2017-09-08 17:53:41 · 4959 阅读 · 3 评论 -
SDUT3333&3332 下一较大值
Problem Description 对于包含n(1<=n<=100000)个整数的序列,对于序列中的每一元素,在序列中查找其位置之后第一个大于它的值,如果找到,输出所找到的值,否则,输出-1。Input 输入有多组,第一行输入t(1<=t<=10),表示输入的组数; 以后是 t 组输入:每组先输入n,表示本组序列的元素个数,之后依次输入本组的n个元素。Output 输出有多原创 2017-09-25 18:12:13 · 619 阅读 · 0 评论 -
ALDS1_5_B 归并排序
#include <iostream>#include <cstdio>#include <algorithm>using namespace std;const int INF = 1 << 30;const int N = 500010;int n,cnt;int A[N]; int L[N>>1]; int R[N>>1];void Merge(int left, int mi原创 2017-10-18 19:08:16 · 475 阅读 · 0 评论