java 标题栈的压入,弹出序列
import java.util.Stack;
class Solution{
public boolean IsPopOrder(int[] pushA,int[] popA){
if(pushA.length==0||popA.length==0) return false;
Stack stack=new Stack();
int j=0;
for(int i=0;i<pushA.length;i++){
stack.push(pushA[i]);
while(!stack.isEmpty()&&stack.peek()==popA[j]){
stack.pop();
j++;
}
}
return stack.isEmpty();
}