diff --git a/chapter_backtracking/backtracking_algorithm.md b/chapter_backtracking/backtracking_algorithm.md index ff387a967..bc34f0dd6 100644 --- a/chapter_backtracking/backtracking_algorithm.md +++ b/chapter_backtracking/backtracking_algorithm.md @@ -290,6 +290,7 @@ comments: true ```cpp title="preorder_find_constrained_paths.cpp" /* 前序遍历 */ void preOrder(TreeNode *root) { + // 剪枝 if (root == nullptr || root->val == 3) { return; }