Solved

Given the Node Class Discussed in Section 17

Question 1

Multiple Choice

Given the Node class discussed in section 17.1 (partially shown below) , select an expression to complete the isLeaf method, which is designed to return true if the node is a leaf, false otherwise. class Node
{
Public Object data;
Public List<Node> children;
) . .
Public boolean isLeaf()
{
Return _______________;
}
}


A) data == null
B) children.get(0) == null
C) children.size() == 0
D) root == null

Correct Answer:

verifed

Verified

Related Questions