mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-18 02:50:19 +08:00
build
This commit is contained in:
@ -290,6 +290,7 @@ comments: true
|
|||||||
```cpp title="preorder_find_constrained_paths.cpp"
|
```cpp title="preorder_find_constrained_paths.cpp"
|
||||||
/* 前序遍历 */
|
/* 前序遍历 */
|
||||||
void preOrder(TreeNode *root) {
|
void preOrder(TreeNode *root) {
|
||||||
|
// 剪枝
|
||||||
if (root == nullptr || root->val == 3) {
|
if (root == nullptr || root->val == 3) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user