classMyStack { public: /** Initialize your data structure here. */ MyStack() { } /** Push element x onto stack. */ voidpush(int x){ std::queue<int> temp_queue; temp_queue.push(x); while(!data_queue.empty()){ temp_queue.push(data_queue.front()); data_queue.pop(); } while(!temp_queue.empty()){ data_queue.push(temp_queue.front()); temp_queue.pop(); } } /** Removes the element on top of the stack and returns that element. */ intpop(){ int x = data_queue.front(); data_queue.pop(); return x; } /** Get the top element. */ inttop(){ return data_queue.front(); } /** Returns whether the stack is empty. */ boolempty(){ return data_queue.empty(); } private: std::queue<int> data_queue; };