摘要: 何海涛面试题22#include<iostream>#include<stack>using namespace std;bool IsPopOrder(int a[],int b[],int n)//压入序列和弹出序列及长度{ bool flag=false; if(n>0) { int i=0,j=0; stack<int>s; while(j<n) { while(s.empty()||s.top()!=b[j])//压入a[5]={1,2,3,4,5}直到元素等于b[0],b[5]={4,5,3,2,1}(正确)和{4,3,5,2,1}( 阅读全文
posted @ 2012-11-13 23:33 代码改变未来 阅读(1019) 评论(0) 推荐(0) 编辑