Vân Anh Nguyen
Member
The insert() procedure, given below, builds the BST on the input elements, which is the first step of the binary tree sort. Choose the correct to fill the condition.
A. newElement > node->value
B. newElement < node->value
C. newElement == root->value
D. newElement != root->value
Code:
void insert(Tree* node, int newElement)
{
if(node== NULL)
{
node = createNewNode();
node-> value = newElement;
node -> left = NULL;
node -> right = NULL;
return;
}
else if(__________________)
{
insert(node->left, newElement);
}
else
{
insert(node->right, newElement);
}
}
B. newElement < node->value
C. newElement == root->value
D. newElement != root->value