Multiple Choice
Consider the following binary search tree diagram: Consider the following addNode method for inserting a newNode into a binary search tree:
public void addNode(Node newNode)
{
int comp = newnode.data.compareTo(data) ;
if (comp < 0)
{
if (left == null) {left = newNode;}
else { left.addNode(newNode) ; }
}
else
{
if (right == null) {right = newNode;}
else { right.addNode(newNode) ; }
}
}
Which of the following trees represents the correct result after inserting element T, calling addNode on the root of the tree?
A) II
B) I
C) IV
D) III
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Given the Node class (partially shown below),
Q2: What is the efficiency of locating an
Q4: Consider the following tree diagrams: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB7392/.jpg"
Q5: What are the differences between preorder, postorder,
Q6: What is the efficiency of the heapsort
Q7: Consider the following binary search tree: <img
Q8: Consider the following tree diagram: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB7392/.jpg"
Q9: A binary tree of height h can
Q10: What is the efficiency of removing an
Q11: Which of the following statements about a