A18439. 下面代码实现二叉搜索树的插入操作。假设树中不存在重复值,横线处应填写( )。TreeNode* insertNode(TreeNode* root, int x) { if (root == nullptr) { return new TreeNode(x); } if (x < root->val) { __________________________ } else { root->rig…
单选题
困难
知识点
题目描述
下面代码实现二叉搜索树的插入操作。假设树中不存在重复值,横线处应填写( )。
TreeNode* insertNode(TreeNode* root, int x) {
if (root == nullptr) {
return new TreeNode(x);
}
if (x < root->val) {
__________________________
} else {
root->right = insertNode(root->right, x);
}
return root;
}选项(单选)
答案解析
详细答案解析为会员权益,按每日次数查看。
开通 / 升级会员
上一题
下一题