Question: In Java, make an array based binary tree with the following specifications: - Create an integer 1 dimensional array named ArrayTree, also an integer variable

In Java, make an array based binary tree with the following specifications:
- Create an integer 1 dimensional array named ArrayTree, also an integer variable for the number of nodes in the array for the tree
- Make a constructor for the array based tree, that is an integer which will be used to create an array based on the parameter
- A method to insert a node into the tree, that checks if the tree is full beforehand
-A method to print out the tree with a loop that gets user input, that checks if the tree is empty before trying to print, then print by each "level" of the tree
-Create two methods, one named findIndex which returns the index of the value in the array tree, and another method called parentIndex, which checks if the value is in the tree and if that value is the parent node. Then return the index of said parent using [(k-1)/2].
Thank you.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!