mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-19 20:55:57 +08:00
build
This commit is contained in:
@ -186,7 +186,18 @@ comments: true
|
||||
=== "C"
|
||||
|
||||
```c title="preorder_traversal_i_compact.c"
|
||||
[class]{}-[func]{preOrder}
|
||||
/* 前序遍历:例题一 */
|
||||
void preOrder(TreeNode *root) {
|
||||
if (root == NULL) {
|
||||
return;
|
||||
}
|
||||
if (root->val == 7) {
|
||||
// 记录解
|
||||
vectorPushback(res, root, sizeof(int));
|
||||
}
|
||||
preOrder(root->left);
|
||||
preOrder(root->right);
|
||||
}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
Reference in New Issue
Block a user