// leetcode 232: implementing queues using stacks class MyQueue { public: MyQueue() { } // push 1 // push 2 // peek void push(int x) { int size = stack1.size(); // move every element in stack1 into stack2 for(int i=0;i stack1; std::stack stack2; }; /** * Your MyQueue object will be instantiated and called as such: * MyQueue* obj = new MyQueue(); * obj->push(x); * int param_2 = obj->pop(); * int param_3 = obj->peek(); * bool param_4 = obj->empty(); */