Question: The instructions are on top of the java code in the first picture. 2 Implement a binary tree using array as underline storage 3 +root

The instructions are on top of the java code in the firstpicture. 2 Implement a binary tree using array as underline storage 3The instructions are on top of the java code in the first picture.

2 Implement a binary tree using array as underline storage 3 +root at index 1, 4 + left child at parent's (index * 2) 5 + right child at parent's (index * 2 1) 6 +parent is at child's (index / 2) 8 1. building a binary tree using array 9 2. implement tree traversals: pre-order, in-order, post-order, level-order 10 3. implement insert met.hod that. insert the element in the order of insert.iorn 12 13 14 15 4. modify the insert method so the tree is a BST 5. add a method called "contains" to search for an element in the tree 6. add methods findMin and findMax 17 21 22 public class ArrTree { 23 24 public static int DEFAULT_SIZE20; //constructors public ArrTree this.buffer- new int [DEFAULT SIZE] this. size = 0 ; 26 27 28 29 30 31 32 public ArrTree (int n) //create a tree with the given size n this.buffer-new int [n+1]; this.size - 0; //empty tree //mutators 34 35public boolean insert (int v) 36 E if (this.size extends out of the leaf return

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!