We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0ad2bc commit 77e5f42Copy full SHA for 77e5f42
java/_094BinaryTreeInorderTraversal.java
@@ -37,7 +37,7 @@ public List<Integer> inorderTraversal(TreeNode root) {
37
List<Integer> result = new ArrayList<>();
38
while (root != null || !stack.empty()) {
39
while (root != null) {
40
- stack.add(root);
+ stack.push(root);
41
root = root.left;
42
}
43
root = stack.pop();
0 commit comments