Write a program that allows the user to experiment

Assignment Help Computer Engineering
Reference no: EM132151406

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.

Reference no: EM132151406

Questions Cloud

Show that the language consisting of those boolean functions : Show that the language consisting of those Boolean functions that are not tautologies is NP-complete.
How do you decide which connections to eliminate : How do you decide which connections to eliminate and which to keep? In other words what information do you need to know about each regional office to determine.
Components of strategy formulation process : Analyse some of the key components of strategy formulation process for an organisation
Group oral presentation and report-communication in it work : Develop an understanding of the need for organisational change, the key influence of human behaviour and its influence on organisational culture.
Write a program that allows the user to experiment : Your task is to write a program that allows the user to experiment with different multi threaded sort algorithms.
How will the website be tested : Quality Assurance: What approaches will be used to ensure that the site functions as expected at launch and in the future?
What must the inventory of the store be in order to conclude : What must the inventory of the store be in order to conclude that there at least 10 shirts in one of the three colors?
Figure out which version of freertos to use : Figure out which version of FreeRTOS to use, one suggestion is V8. RUN IT AND WATCH [there are V9 and V6 at least, available]
Write a shell script that takes a file name as a parameter : Write a shell script that takes any command as a parameter and displays help on that command (e.g. the result of execution of man ).

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd