Sale!

CSC 4520 HW3 solution

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (6 votes)

Given this Tree T, answer the following questions:

1 Assuming T is defined in Java, what code do I write to get “sun” back?
2 What will System.out.println(T.getChildren().get(2).getChildren()) output? Be
as specific as possible.

3 Given the following code, what will we output for mystery(T)?
public static void mystery(TreeNode node) {
List<TreeNode> children = node.getChildren();
for (int i = 1; i < children.size(); i++) {

TreeNode child = children.get(i);
System.out.println(child.getValue());
mystery(child);
}
}

CSC 4520 HW3