Closed LiYinJiang closed 4 years ago
public int pop() throws Exception { if (stack2.isEmpty()) { while (!stack1.isEmpty()) { stack2.push(stack1.pop()); } }
if (stack1.isEmpty()) { throw new Exception("queue is empty"); } return stack2.pop(); }
百分百抛Bug
@LiYinJiang 确实,应该是
if (stack2.isEmpty()) { throw new Exception("queue is empty"); }
你提个pr吧
pr修复
public int pop() throws Exception { if (stack2.isEmpty()) { while (!stack1.isEmpty()) { stack2.push(stack1.pop()); } }
百分百抛Bug