function IsPopOrder(pushV, popV) { //创建一个模拟栈 let stack = []; //遍历入栈数组 for (let i = 0; i < pushV.length; i++) { //压入模拟栈中 stack.push(pushV[i]); //当模拟栈非空时 while (stack.length > 0) { //如果栈顶元素和弹出元素匹配 if (stack[stack.length - 1] == popV[0]) { //弹出栈顶元素 stack.pop(); //由于popV前面的已经没用了,直接移除 popV.shift();...