http://www.luyixian.cn/news_show_21852.aspx
https://blog.csdn.net/derrantcm/article/details/46691083
bool isOrder(int p[], int lenP, int q[], int lenQ) {
if (p == NULL || q == NULL || lenP == 0 || lenQ == 0) {
return false;
}
stack<int> stackT = new stack();
int pushIndex = 0;
int popIndex = 0;
while (popIndex <= lenQ-1) {
while (pushIndex <= lenP-1 &&(stackT.isEmpty() || stackT.top()!=q[popIndex]) ) {
stackT.push(p[pushIndex]);
pushIndex++;
}
if (stackT.top()==q[popIndex]) {
stackT.pop();
popIndex++;
}
else {
return false;
}
}
return stackT.isEmpty();
}