public class Solution {
Stack<Integer> stack1 = new Stack<Integer>();
Stack<Integer> stack2 = new Stack<Integer>();
public void push(int node) {
    stack1.push(node);
   }
   public int pop() {
      if(stack1.empty()&&stack2.empty()){
        throw new RuntimeException("Queue is empty!");
      }
      if(stack2.empty()){
        while(!stack1.empty()){
          stack2.push(stack1.pop());
        }
      }
      return stack2.pop();
  }
}

最新文章

  1. .NET平台开源项目速览(2)Compare .NET Objects对象比较组件
  2. Smooth Mouse
  3. LINK : fatal error LNK1104: 无法打开文件“gtestd.lib”
  4. 关于touch事件对于性能的影响
  5. linux挂载硬盘失败,报错!
  6. Oracle表连接
  7. 从APP消息推送所理解的观察者模式
  8. Java学习之异常处理
  9. POJ 2991 Crane(线段树+计算几何)
  10. web端和手机端测试有什么不同
  11. ZZNU 1993: cots&#39; friends
  12. (基础篇 走进javaNIO)第一章-java的i/o演进之路
  13. mysql高级之编程优化
  14. APICloud |UIChatTools 模块demo
  15. springMVC控制器,处理器,映射器,适配器
  16. 最短路径之Bellman-Ford算法
  17. 关于js特效轮播图练习
  18. 轻量架构ShuffleNet V2:从理论复杂度到实用设计准则
  19. git-ftp代码部署方式
  20. 使用cuteFTP与虚拟机交互文件---安装ftp服务

热门文章

  1. 本地开发环境伪装成SSL连接的实现
  2. 吴恩达deepLearning.ai循环神经网络RNN学习笔记_没有复杂数学公式,看图就懂了!!!(理论篇)
  3. python 实现 跳一跳游戏 代码解析
  4. ubuntu16.04 自建源
  5. LVM 逻辑卷 (logica volume manager)
  6. Spring MVC系列之JDBC Demo(SpringBoot)(七)
  7. Leetcode:96. 不同的二叉搜索树
  8. cf1294E
  9. The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports.
  10. 从零开始一个个人博客 by asp.net core and angular(二)