Question
I need help getting this Java program to run. import java.util.*; public class DrawTree { public String[] draw(int[] parents, String[] names) { int rootIndex =
I need help getting this Java program to run.
import java.util.*;
public class DrawTree { public String[] draw(int[] parents, String[] names) { int rootIndex = findRoot(parents); List
//here is the class DrawTree drawTree = new DrawTree(); int[] parents = {-1, 0, 1, 1, 0, 0, 5, 5}; String[] names = {"Root", "SubB", "LEAF1", "LEAF2", "LEAF3", "SubA", "LEAF4", "LEAF5"}; String[] result = drawTree.draw(parents, names); for (String line : result) { System.out.println(line); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started