Merge fd04d7e653
into 73272eaf61
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user