标签:off span public https top get .com ack pop
class Solution { public: bool IsPopOrder(vector<int> pushV,vector<int> popV) { if(pushV.size() == 0){ return false; } stack<int> s; for(int i = 0,j = 0;i < pushV.size();++i){ s.push(pushV[i]); while(j < popV.size() && s.top() == popV[j] && !s.empty()){ s.pop(); ++j; } } return s.empty(); } };
标签:off span public https top get .com ack pop
原文地址:http://www.cnblogs.com/dingxiaoqiang/p/7469139.html