Main.java x Console shell import java.util.*; > javac -classpath .:/run_dir/junit-4.12.jar:target/dependency/* -d . arySearchTree1.java Main.java Main.java:8: erIor: getHeight() has private access in BinarySearchTreef int height=myTree.getHeight(); 2 v public class Main{ public static void main(String [] args){ BinarySearchTree1 myTree = new BinarySearchTree1(); 4 Main.java:10: error: getlargestkey () has private access in BinarySearch 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 12 float avg=getAverage(); symbol: location: class Main method getAverage() 13 14 3 errors 15 exit status 1

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Fix the main file errors

 

 

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 )
* LO
Transcribed Image 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 ) * LO
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
Transcribed Image 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
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Threads in linked list
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education