Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Thank you.
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