Your task is to write a program that allows the user to


Question task

Your task is to write a program that allows the user to experiment with different multi threaded sort algorithms.

You should provide the user with an interface that looks very similar to the one shown below.

The user should be able to select the type of sorting algorithm to be used (selection, bubble, insertion, or quick, the size of the array to sort, the type of values to put in the array (already sorted in ascending order, sorted in reverse (descending) order, or random numbers between 0 and 99), and the number of values to sort in each thread.

When the user clicks on the Go button, you should validate all of the input. If the user has not provided required input or if the input is invalid (a negative input size, for example), you should display an alert dialog explaining the problem. Otherwise, collect all of the input and generate an appropriate array of integer values.

Then, "chunk" the array into the desired block size and pass each chunk to a thread that sorts the chunk into ascending order using the algorithm chosen by the user.

When all of the chunks have been sorted, put the resulting sorted integer arrays into a queue.

Then, poll two sorted chunks at a time from the queue, spawn a thread to merge them, and push the new merged array back onto the queue.

Repeat this process until there is only a single integer array in the queue. This array should now be sorted.

Display the sorted array to the console, and use an alert dialog to show the user how many milliseconds the sort process took.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Your task is to write a program that allows the user to
Reference No:- TGS02944855

Expected delivery within 24 Hours