Skip to content

Commit

Permalink
Merge pull request youngyangyang04#964 from IcePigZDB/diGuiWithRecall
Browse files Browse the repository at this point in the history
二叉树中递归带着回溯 格式化CPP代码显示
  • Loading branch information
youngyangyang04 authored Dec 31, 2021
2 parents 76df79a + 4545e48 commit c6e12a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions problems/二叉树中递归带着回溯.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public:


如下为精简之后的递归代码:(257. 二叉树的所有路径)
```
```CPP
class Solution {
private:
void traversal(TreeNode* cur, string path, vector<string>& result) {
Expand Down Expand Up @@ -131,8 +131,7 @@ traversal(cur->left, path, result); // 左
即:
```

``` CPP
if (cur->left) {
path += "->";
traversal(cur->left, path, result); // 左
Expand Down

0 comments on commit c6e12a4

Please sign in to comment.