下面代码实现二叉搜索树的插入操作。假设树中不存在重复值,横线处应填写( )。
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;
}
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析