第23771题 单选题
实现二叉排序树搜索功能的C++代码横线处应填入的正确内容是?

以下代码希望能在一棵二叉排序树中搜索特定的值,请在横线处填入正确选项,使其能正确实现相应功能。

TreeNode* search(TreeNode* root, int target) {
    if (root == NULL || root->val == target) {
        return root;
    }
    if (________________) {
        return search(root->left, target);
    } else {
        return search(root->right, target);
    }
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析