//// Created by bleedingfight on 2020年6月28日.//#include "MyQueue.h"void MyQueue::push(int x) {head_stack.push(x);}int MyQueue::pop() {int top_value = peek();tail_stack.pop();return top_value;}int MyQueue::peek() {if (tail_stack.empty()){while (!head_stack.empty()){tail_stack.push(head_stack.top());head_stack.pop();}}int top_value = tail_stack.top();return top_value;}bool MyQueue::empty() {return head_stack.empty()&&tail_stack.empty();}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。