Question: Java A company wants to implement its customer registry as a binary search called CustomerBST. Write a class, called CustomerNode, to hold the following information

Java A company wants to implement its customer registry as a binary search called CustomerBST.
Write a class, called CustomerNode, to hold the following information about a customer:
id (as an int)
name (as a String)
balance (as a double)
left (a reference to the left CustomerNode object)
right (a reference to the right CustomerNode object)
Write the CustomerBST class, which is a binary search tree to hold objects of the class CustomerNode. The key in each node is the id. This class should define an instance variable root (the only instance variable of the class) and should implement the following interface CustomerIF.Write a TestCustomerBST class to test the above classes. This class should have a main method in which you perform the following actions:
Create a CustomerBST object.
Insert 40 CustomerNode objects (using a for loop) into the created BST in the following way:
customerID is a random number between 0 and 1000.
name can be a string that you randomly pick from a predefined array of strings.
balance is a random number between 1 and 10000.
Call the preorder traversal method and print out its resulting LinkedList of nodes.
Call the inorder traversal method and print out its resulting LinkedList of nodes.
Call the postorder traversal method and print out its resulting LinkedList of nodes.
Print out the number of customers that have a balance greater than 5000.
Print out the details about the customer node with the smallest customerID.
Print out the details about the customer node with the highest customerID.
 Java A company wants to implement its customer registry as a

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!