Examveda

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.
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);
	}
}

A. newElement > node->value

B. newElement < node->value

C. newElement == root->value

D. newElement != root->value

Answer: Option B


This Question Belongs to Data Structure >> Sorting Algorithms

Join The Discussion

Related Questions on Sorting Algorithms