Question
Please use the source below for coding and it requres left and right child of the tree as binery tree serach based on question below
Please use the source below for coding and it requres left and right child of the tree as binery tree serach based on question below
A database is to be developed to keep track of student information at your college. Their names, identification numbers, and grade point averages will be included. The data set will be accessed in the key field mode, with the student's name being the key field. Code a class named Listing that defines the nodes. The class must comply with the guidelines that permit student information nodes to be stored in the fully encapsulated BinaryTree structure. As such, your class should include all the methods in the class shown in Figure 2.16 and include a getKey method. Test it with a progressively developed driver program that demonstrates the functionality of all of its methods. When launched, the user will be presented with the following menu:
Enter:
1 to insert a new student's information,
2 to fetch and output a student's information,
3 to delete a student's information,
4 to update a student's information,
5 to output all the student information in descending order, and
6 to exit the program.
Figure 2.16:
Using
1.1.BinaryTree
2.BinaryTreeWithLNRTraversal
3.MainBinaryTree
4.MainBinaryTreeWithLNRTraversal
this is all example from a sourses chapter 7 data stracture by willim McAllister
1. public class Listing 2. private String name; / key field private String address; private String number public Listing(String n, String a, String num) fname n; 6 address a ; numbernum; 8 9 10 11. public String toString(O returnName is+name + "InAddress is +address+ "InNumber isnumbern 15 16. public Listing deepCopy () Listing clonenew Listing(name, address, number); return clone public int compareTo(String targetKey) return (name.compareTo(targetKey)) 20 21.) public void setAddress (String a) coded to demonstrate // encapsulation 23. 24. 25. address a; end of setAddress method end of class ListingStep 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