Question: Step 1. Create a Java project and create a Main class and a main method. (similar steps in:https/sjiang1 github.io/classes/java2/18fall/assignment 13.pdf (1.0) Step 2. Create a
Step 1. Create a Java project and create a Main class and a main method. (similar steps in:https/sjiang1 github.io/classes/java2/18fall/assignment 13.pdf (1.0) Step 2. Create a class, Tree Inside the class, define an inner class: TreeNode (10) Step 3. Define the TreeNode The inner class TreeNode should have the following instance variables: 1. private int va 2. private TreeNode left 3. private TreeNode right Add a constructor with the input parameters: int theVal nside the constructor, initialize this.val with theVal, initialize this.left and this.right with null. 1.0)Step4. Define the Tree The class Tree should have one instance variable: private TreeNode root First, add a constructor to the class Tree. The constructor should have one input parameter: int theVal The constructor should do: 1. this.root should be initialized with a new Tree Node with theVal Then, add the following method to Tree: public void insert(int newVal, Boolean isLeft)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
