void dfs(TreeNode *root, char x)
{
if (!root) return;
if (root->val == x) root = NULL;
else
{
cout << root->val << ' ';
dfs(root->left, x);
dfs(root->right, x);
}
}
08-20
415
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-24
521
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-20
258
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)