Multiple Choice
Given the BinaryTree class discussed in section 17.2 (partially shown below) , select an expression to complete the static recursive helper method rightMostValue, which is designed to return the data value in the rightmost node of the tree rooted at node n. public class BinaryTree
{
Private Node root;
Public BinaryTree()
{
Root = null;
}
Public BinaryTree(Object rootData, BinaryTree left, BinaryTree right)
{
Root = new Node() ;
Root.data = rootData;
Root.left = left.root;
Root.right = right.root;
}
Class Node
{
Public Object data;
Public Node left;
Public Node right;
}
Public Object rightMostValue()
{
If (root == null)
{
Return null;
}
Else
{
Return rightMostValue(root) ;
}
}
Public static Object rightMostValue(Node n)
{
If (n.right == null)
{
Return n.data;
}
Else
{
Return ______________________;
}
}
}
A) rightMostValue(n.right)
B) rightMostValue(n.left)
C) rightMostValue(n)
D) rightMostValue(root.right)
Correct Answer:

Verified
Correct Answer:
Verified
Q55: Consider the following tree diagram: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB7390/.jpg"
Q56: As implemented in the textbook, a tree
Q57: When we map a min-heap with n
Q58: Consider the following binary search tree diagram:
Q59: Consider the following tree diagrams: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB7390/.jpg"
Q61: If the postorder traversal visits the nodes
Q62: A completely filled binary tree with a
Q63: What is the complexity of adding an
Q64: If the postorder traversal of an expression
Q65: If the postorder traversal of an expression