class Solution{ /* * 分析: 数据经过两个栈 一次性压栈, 在出栈 就是队列 * 1、 每次压栈的时候都需要将栈2里面的数据先压入栈1, 才能保证先压入栈的数据始终在栈1下面 * 2、 出栈的时候。 先将栈1里面的数据全部压入栈2, 然后从栈2出栈 */public: void push(int node) { while(!stack2.empty()) { stack1.push(stack2.top()); stack2.pop(); } stack1.push(node); } int...