Java Binary Search Tree Solution
Not what you're looking for?
Dear OTA -
I need a Java solution named TestGRE.java with a main method to test a Student Graduate Record Examination Score Managment System using BinarySearchTree java classes.
The solution should use the attached Student class.
Also, sample input that can be used is contained in the attached StudData.dat file.
The TestGRE should return the following when run from the command line:
C:JavaBinSearchTree>java TestGRE
Please Enter a valid FileName: StudData.dat
Choose an operation:
1: contains (string)
2: remove (string)
3: add (string)
4: print (traversal order)
9: stop Testing
Enter choice: 4
Choose a traversal order:
1: Preorder
2: Inorder
3: Postorder
3
The tree in Postorder is:
Brown in NJ earns 89 verbal, and 67 quantitative.
Arnold in VA earns 77 verbal, and 88 quantitative.
Thompson in NY earns 99 verbal, and 99 quantitative.
John in VA earns 89 verbal, and 89 quantitative.
Conner in NY earns 98 verbal, and 100 quantitative.
Smith in MD earns 89 verbal, and 89 quantitative.
Choose an operation:
1: contains (string)
2: remove (string)
3: add (string)
4: print (traversal order)
9: stop Testing
Enter choice: 2
Enter Student's Name to remove: Arnold
Verbal Score: 77
Quantitative Score: 88
State: VA
remove(Arnold, 77, 88, VA) returns true
Choose an operation:
1: contains (string)
2: remove (string)
3: add (string)
4: print (traversal order)
9: stop Testing
Enter choice: 4
Choose a traversal order:
1: Preorder
2: Inorder
3: Postorder
3
The tree in Postorder is:
Brown in NJ earns 89 verbal, and 67 quantitative.
Thompson in NY earns 99 verbal, and 99 quantitative.
John in VA earns 89 verbal, and 89 quantitative.
Conner in NY earns 98 verbal, and 100 quantitative.
Smith in MD earns 89 verbal, and 89 quantitative.
Choose an operation:
1: contains (string)
2: remove (string)
3: add (string)
4: print (traversal order)
9: stop Testing
Enter choice: 3
Enter Student's Name to add: Arnold
Verbal Score: 77
Quantitative Score: 78
State: CT
Choose an operation:
1: contains (string)
2: remove (string)
3: add (string)
4: print (traversal order)
9: stop Testing
Enter choice: 4
Choose a traversal order:
1: Preorder
2: Inorder
3: Postorder
2
The tree in Inorder is:
Arnold in CT earns 77 verbal, and 78 quantitative.
Brown in NJ earns 89 verbal, and 67 quantitative.
John in VA earns 89 verbal, and 89 quantitative.
Thompson in NY earns 99 verbal, and 99 quantitative.
Smith in MD earns 89 verbal, and 89 quantitative.
Conner in NY earns 98 verbal, and 100 quantitative.
Choose an operation:
1: contains (string)
2: remove (string)
3: add (string)
4: print (traversal order)
9: stop Testing
Enter choice: 9
C:JavaBinSearchTree>
Now I just need the following missing code to test this system, and to make this all work:
import java.util.*;
import java.util.Scanner;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
import java.io.IOException;
public class TestGRE
{
public static void main(String[] args) throws IOException
{
....
}
Purchase this Solution
Solution Summary
The expert examines Java binary search tree solutions.
Purchase this Solution
Free BrainMass Quizzes
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.
C# variables and classes
This quiz contains questions about C# classes and variables.
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.
C++ Operators
This quiz tests a student's knowledge about C++ operators.
Basic Computer Terms
We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.