Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6ecb80c

Browse files
committed
binary tree pos order traversal
1 parent 4d38cad commit 6ecb80c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/main/java/grey/algorithm/Code_0012_LeetCode_0145_BinaryTreePostorderTraversal.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ public List<Integer> postorderTraversal2(TreeNode root) {
5353
}
5454
// TODO
5555
// 【非递归】【单栈】后序遍历
56-
public static List<Integer> postorderTraversal1(TreeNode head) {
56+
public static List<Integer> postorderTraversal1(TreeNode root) {
5757
List<Integer> ans = new ArrayList<>();
58-
if (null == head) {
58+
if (null == root) {
5959
return ans;
6060
}
6161
Stack<TreeNode> stack = new Stack<>();
6262
TreeNode c;
63-
TreeNode h = head;
63+
TreeNode h = root;
6464
stack.push(h);
6565
while (!stack.isEmpty()) {
6666
c = stack.peek();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /