Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

?IN JAVA QUESTION: 10.3 A 2-3-4 tree can be used as a sorting machine. Write a sort() method thats passed an array of key values

?IN JAVA

QUESTION:

10.3 A 2-3-4 tree can be used as a sorting machine. Write a sort() method thats passed an array of key values from main() and writes them back to the array in sorted order.

?IN THIS PROGRAME PLEASE USE THIS MAIN METHOD..

image text in transcribedimage text in transcribed

OUTPUT:

image text in transcribed

Please make sure it work..Please do it as soon as possible. Thanks...

In the Tree234 you may add fields: longll sortArray; int sortlndex; // ref to array for sort // index into sortArray and methods sort(longl] arr, int size) and recSort(Node thisNode) public static void main(Stringl) args) Tree234 theTree new Tree2340) int size 20; longl] theArray (100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 5, 15, 25, 35, 45, 55, 65, 75, 85,95 System.out.println("Unsorted:"); for(int j-0; jksize; jt+) System.out.print( theArrayil+" System.out.println("); theTree.sort(theArray, size); //sort the array System.out.println("Sorted:")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

=+7. What is the big message you want them to know? (THINK SLOGAN.)

Answered: 1 week ago