第21248题 单选题
二叉排序树递归搜索函数的空缺条件处应填入哪项代码?

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

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 }}%
答案解析