![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
小练
The C
Don't tell me the sky is the limit when there are footprints on the moon.
展开
-
小练day01
顺序表逆置问题: 采用双指针,保证时间和空间上高效 void Reverse(Sqlist &S,int m,int n) { while(m<n) { int temp = S.data[m]; S.data[m] = S.data[n]; S.data[n] = temp; m++; ...原创 2019-09-07 21:43:27 · 61 阅读 · 0 评论 -
栈、队列、串专题
题目:设有一个元素类型为整型的栈S,设计一个算法,借助另一个栈实现把该栈的所有元素从栈顶到栈底按从小到大次序排列起来 代码展示:(注意来回倒时候终止条件) void SortByAnotherStack(Stack &S1,Stack &S2) { if(S1.top==-1 || S1.top==0) return; int t,temp; while(S...原创 2019-10-08 20:31:12 · 296 阅读 · 0 评论