Question: Write a program that animates the merge of two sorted lists. Create two arrays, list1 and list2, each of which consists of 8 random numbers
Write a program that animates the merge of two sorted lists. Create two arrays, list1 and list2, each of which consists of 8 random numbers from 1 to 999. The array elements are displayed, as shown in Figure 23.22a. Clicking the Step button causes the program to move an element from list1 or list2 to temp. Clicking the Reset button creates two new random arrays for a new start. When the algorithm is finished, clicking the Step button displays a message to inform the user.
currenti current2 listi 95 173 430 677 781 811 901 910 listz 49 121 291 315 380 803 912 916 temp 49 95 121 173 291 315 current3 Slep Reset (a)
Step by Step Solution
3.31 Rating (163 Votes )
There are 3 Steps involved in it
Program Plan Create a class Main to animate the merge sort Extend this class to Application class Create a MergePane class and extend it to Pane class Define its properties such as origin points and s... View full answer
Get step-by-step solutions from verified subject matter experts
