This commit is contained in:
a188616786a
2018-07-19 06:47:53 +00:00
committed by GitHub

View File

@ -411,6 +411,9 @@ Stack<Integer> in = new Stack<Integer>();
Stack<Integer> out = new Stack<Integer>(); Stack<Integer> out = new Stack<Integer>();
public void push(int node) { public void push(int node) {
if (in.isEmpty())
while (!out.isEmpty())
in.push(out.pop());
in.push(node); in.push(node);
} }