diff --git a/problems/二叉树中递归带着回溯.md b/problems/二叉树中递归带着回溯.md index 372a4660..27ed7a6f 100644 --- a/problems/二叉树中递归带着回溯.md +++ b/problems/二叉树中递归带着回溯.md @@ -90,8 +90,7 @@ public: 如下为精简之后的递归代码:(257. 二叉树的所有路径) -CPP -``` +```CPP class Solution { private: void traversal(TreeNode* cur, string path, vector& result) { @@ -132,8 +131,7 @@ traversal(cur->left, path, result); // 左 即: -``` - +``` CPP if (cur->left) { path += "->"; traversal(cur->left, path, result); // 左