Question: JAVA (BOOK: Data Structure and algorithms 2nd edition) QUESTION: 10.3 A 2-3-4 tree can be used as a sorting machine. Write a sort() method thats
JAVA (BOOK: Data Structure and algorithms 2nd edition)
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.
PLEASE USE THE MAIN METHOD (AND OTHER DIRECTIONS) GIVEN BELOW:


PLEASE MAKE SURE THE OUTPUT IS SAME.
DO IT AS SOON AS POSSIBLE. THANKS...
In the Tree234 you may add fields: longl sortArray; int sortindex; // ref to array for sort0) // index into sortArray and methods: sort(long[] arr, int size) and recSort(Node thisNode) public static void main(String[l 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; j
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
