Question: In JAVA I am using Data Structure and algoritms in Java Second Edition Program Must Compile and run! This project should be easy. Write a

In JAVA

I am using Data Structure and algoritms in Java Second Edition

Program Must Compile and run!

This project should be easy. Write a program that returns the minimum value in a 2-3-4 tree.

In text please

MUST COMPILE AND RUN ,PLEASE DISPLAY OUTPUT With Comments. IN TEXT

Include Main method below in program

public static void main(String[] args) throws IOException

{

long value;

Tree234 theTree = new Tree234();

theTree.insert(50);

theTree.insert(40);

theTree.insert(60);

theTree.insert(30);

theTree.insert(70);

while(true)

{

System.out.print("Enter first letter of ");

System.out.print("show, insert, find, or minimum: ");

char choice = getChar();

switch(choice)

{

case 's':

theTree.displayTree();

break;

case 'i':

System.out.print("Enter value to insert: ");

value = getInt();

theTree.insert(value);

break;

case 'f':

System.out.print("Enter value to find: ");

value = getInt();

int found = theTree.find(value);

if(found != -1)

System.out.println("Found "+value);

else

System.out.println("Could not find "+ value);

break;

case 'm':

value = theTree.getMin();

System.out.println("Minimum value is " + value);

break;

default:

System.out.print("Invalid entry ");

} // end switch

} // end while

} // end main()

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!