Skip to content

Commit

Permalink
Merge pull request youngyangyang04#2512 from gggxxxx/XiongGu-branch
Browse files Browse the repository at this point in the history
Add dfs function execution in the tree traversal (Python)
  • Loading branch information
youngyangyang04 authored May 7, 2024
2 parents 1f1fe28 + 2d0b16c commit 73f9904
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions problems/二叉树的递归遍历.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ class Solution:
res.append(node.val)
dfs(node.left)
dfs(node.right)


dfs(root)
return res

```
Expand All @@ -206,7 +207,8 @@ class Solution:
dfs(node.left)
res.append(node.val)
dfs(node.right)


dfs(root)
return res
```
```python
Expand All @@ -224,7 +226,8 @@ class Solution:
dfs(node.left)
dfs(node.right)
res.append(node.val)


dfs(root)
return res
```

Expand Down

0 comments on commit 73f9904

Please sign in to comment.