BinarySearchTree1.java x 1 import java.util.*; 2 public class BinarySearchTreel 3 , { public Node root; private int max; private int count=0; private int sum=0; public BinarysearchTree1 () { 4 7 9...


Fix the main file errors




BinarySearchTree1.java x<br>1 import java.util.*;<br>2 public class BinarySearchTreel<br>3 , {<br>public Node root;<br>private int max;<br>private int count=0;<br>private int sum=0;<br>public BinarysearchTree1 () {<br>4<br>7<br>9<br>root = null;<br>10<br>11 v<br>public Node getroot () {<br>12<br>return root;<br>13<br>14 v<br>public Node Search(int KEY) {<br>15<br>Node x = root;<br>while (x != null && x.item != KEY) {<br>if (KEY < x.item) {<br>x = x.Left;<br>} else {<br>x = x.Right;<br>16 v<br>17 v<br>18<br>19 y<br>20<br>21<br>22<br>return x; // x.item<br>key or x == null<br>23<br>==<br>24<br>25<br>public Node SearchRec (Node root, int key)<br>26 v<br>if (root == nul1)<br>return null;<br>27<br>28<br>29<br>if ( root.item ==<br>key )<br>* LO<br>

Extracted text: BinarySearchTree1.java x 1 import java.util.*; 2 public class BinarySearchTreel 3 , { public Node root; private int max; private int count=0; private int sum=0; public BinarysearchTree1 () { 4 7 9 root = null; 10 11 v public Node getroot () { 12 return root; 13 14 v public Node Search(int KEY) { 15 Node x = root; while (x != null && x.item != KEY) { if (KEY < x.item)="" {="" x="x.Left;" }="" else="" {="" x="x.Right;" 16="" v="" 17="" v="" 18="" 19="" y="" 20="" 21="" 22="" return="" x;="" x.item="" key="" or="" x="=" null="" 23="=" 24="" 25="" public="" node="" searchrec="" (node="" root,="" int="" key)="" 26="" v="" if="" (root="=" nul1)="" return="" null;="" 27="" 28="" 29="" if="" (="" root.item="=" key="" )="" *="">
Main.java x<br>Console Shell<br>import java.util.*;<br>2 v public class Main{<br>> javac -classpath .:/run_dir/junit-4.12.jar:target/dependency/* -d . Bin<br>arySearchTree1.java Main.java<br>Main.java:8: error: getHeight() has private access in BinarySearchTree1<br>int height=myTree.getHeight();<br>4<br>public static void main(String [] args){<br>BinarySearchTreel myTree = new BinarySearchTree1();<br>Main.java:10: error: getlargestKey () has private access in BinarySearchTI<br>ee1<br>myTree.Insert (1);<br>int height=myTree.getHeight ();<br>int largestkey=myTree.getLargestKey ();<br>8.<br>int largestkey=myTree.getLargestkey ();<br>Main.java:12: error: cannot find symbol<br>float avg=getAverage();<br>10<br>11<br>float avg=getAverage ();<br>symbol: method getAverage ()<br>location: class Main<br>12<br>13<br>14<br>3 errors<br>15<br>exit status 1<br>

Extracted text: Main.java x Console Shell import java.util.*; 2 v public class Main{ > javac -classpath .:/run_dir/junit-4.12.jar:target/dependency/* -d . Bin arySearchTree1.java Main.java Main.java:8: error: getHeight() has private access in BinarySearchTree1 int height=myTree.getHeight(); 4 public static void main(String [] args){ BinarySearchTreel myTree = new BinarySearchTree1(); Main.java:10: error: getlargestKey () has private access in BinarySearchTI ee1 myTree.Insert (1); int height=myTree.getHeight (); int largestkey=myTree.getLargestKey (); 8. int largestkey=myTree.getLargestkey (); Main.java:12: error: cannot find symbol float avg=getAverage(); 10 11 float avg=getAverage (); symbol: method getAverage () location: class Main 12 13 14 3 errors 15 exit status 1

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here