以下代码实现了二叉排序树的哪种操作?
1 TreeNode* op(TreeNode* root, int val) { 2 if (root == nullptr) return new TreeNode(val); 3 if (val < root->val) { 4 root->left = op(root->left, val); 5 } else { 6 root->right = op(root->right, val); 7 } 8 return root; 9 }
查找
插入
删除
遍历