mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-25 18:08:48 +08:00
Update
This commit is contained in:
@ -223,12 +223,12 @@ public:
|
||||
文中我明确的说了:**回溯就隐藏在traversal(cur->left, path + "->", result);中的 path + "->"。 每次函数调用完,path依然是没有加上"->" 的,这就是回溯了。**
|
||||
|
||||
如果还不理解的话,可以把
|
||||
```
|
||||
```C++
|
||||
traversal(cur->left, path + "->", result);
|
||||
```
|
||||
|
||||
改成
|
||||
```
|
||||
```C++
|
||||
string tmp = path + "->";
|
||||
traversal(cur->left, tmp, result);
|
||||
```
|
||||
|
Reference in New Issue
Block a user