Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In java language. I need help with the methods in part 2. Part 1 explains the implementation already done for me. Part 1- The problem
In java language. I need help with the methods in part 2. Part 1 explains the implementation already done for me.
Part 1- The problem description DO NOT MOVE TO NEXT STEPS BEFORE READING THIS PART CAREFULLY For this lab, you are asked to write methods to be added to IntTree.java As explained above, this class is started for you and the basic functionality is already implemented for you. DO NOT modify the methods provided. The current implementation provides a simple binary tree class that includes methods to construct a tree of integer values to print the data using an in-order traversal. Two constructors have been provided for you: 1) public IntTreeCint max) The trees built using this constructor have nodes numbered starting with 1 and numbered sequentially level by level with no gaps in the trees till the max value (saw during the lecture). For instance IntTree(6) would create the following tree. a. 456 2) public IntTree(intC] arr) The trees built using this constructor will use the integer values in the input array sequentially to fill the tree as before level by level. If the input integer value is-1, the corresponding node will be skipped. For instance, the following lines will create the tree illustrated below: a. int arr2 - [2, 8, 1, 0, -1, 7, 6, -1, -1, -1, -1, 4, -1, -1, 9; IntTree tree_ref2 new IntTree(arr2); tree ref2 Remember that one of the purposes of this week is to practice recursive programming. Almost all of the following methods are easier to write recursively. Remember that you ARE NOT allowed to change the signature of the methods. However, you are allowed to use helper
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