A67153. 以下函数实现了二叉排序树(BST)的( )操作。TreeNode* op(TreeNode* root, int x) {
单选题
知识点
题目描述
以下函数实现了二叉排序树(BST)的( )操作。
TreeNode* op(TreeNode* root, int x) {
if (!root) return new TreeNode(x);
if (x < root->val)
root->left = op(root->left, x);
else
root->right = op(root->right, x);
return root;
}选项(单选)
答案解析
详细答案解析为会员权益,按每日次数查看。
开通 / 升级会员