Implement a C# application to sort 'N' randomly generated numbers using Rank sort. The Program should...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Implement a C# application to sort 'N' randomly generated numbers using Rank sort. The Program should use following three design techniques: a) Serial (single threaded) application b) Multithreaded application (using Thread objects) c) Multithreaded application (using a ThreadPool) Compute the execution time of these three techniques using randomly generated arrays of different sizes (for N = 100, 500, 1000, 2000, 5000, 10000, 20000, 50000 and 100000). Prepare a comparison table to compare the performance of these three techniques. Conclude your findings. (Hint: Stopwatch class can be used to log execution time). N 100 500 1000 5000 10000 20000 50000 100000 Serial Time Multithreaded Time ThreadPool Time Rank Sort: The idea of Rank sort is simple: The numbers that are smaller than each selected number are counted. This count provides the position of selected number in sorted list; that is, its "rank". First a[0] is read and compared with each of the other numbers, a[1] ... a[n-1], recording the number of numbers less than a[0]. Suppose this number is x. This is the index of the a[0] in the final sorted list. The number a[0] is copied into the final sorted list b[0] ... b[n-1], at location b[x]. The same actions are repeated with the other numbers. Implement a C# application to sort 'N' randomly generated numbers using Rank sort. The Program should use following three design techniques: a) Serial (single threaded) application b) Multithreaded application (using Thread objects) c) Multithreaded application (using a ThreadPool) Compute the execution time of these three techniques using randomly generated arrays of different sizes (for N = 100, 500, 1000, 2000, 5000, 10000, 20000, 50000 and 100000). Prepare a comparison table to compare the performance of these three techniques. Conclude your findings. (Hint: Stopwatch class can be used to log execution time). N 100 500 1000 5000 10000 20000 50000 100000 Serial Time Multithreaded Time ThreadPool Time Rank Sort: The idea of Rank sort is simple: The numbers that are smaller than each selected number are counted. This count provides the position of selected number in sorted list; that is, its "rank". First a[0] is read and compared with each of the other numbers, a[1] ... a[n-1], recording the number of numbers less than a[0]. Suppose this number is x. This is the index of the a[0] in the final sorted list. The number a[0] is copied into the final sorted list b[0] ... b[n-1], at location b[x]. The same actions are repeated with the other numbers.
Expert Answer:
Answer rating: 100% (QA)
Answer Below is a C implementation of Rank sort using three design techniques serial singlethreaded multithreaded application using Thread objects and multithreaded application using a ThreadPool We w... View the full answer
Related Book For
Auditing and Assurance services an integrated approach
ISBN: 978-0132575959
14th Edition
Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley
Posted Date:
Students also viewed these accounting questions
-
Which heading elements use fonts that are smaller than the normal text font size?
-
List three ways in which random numbers may be generated for use in a simulation.
-
Compare the different techniques that can be used in capital budgeting analysis.
-
Who was the highest paid athlete in sports in the 1 9 9 0 s ?
-
Do you tweet? Twitter claims its users are sending 400 million tweets a day. Thats a lot of Twitter chatter! What is sentiment analysis? How do organizations use sentiment analysis to manage customer...
-
Which statutory and judicial reforms of the 1970s and 1980s in the law of rape were the most significant from a female victims standpoint? Are there other biases against female victims of sexual...
-
When the plaintiff was 16, he was employed by Kmart as a cashier. At the end of his training, he was required to read Kmarts policy agreement, which included an agreement to submit all employment...
-
1. What action would you recommend to the Board of Regents? 2. How should Strutledge go about making a strategic decision such as this? Strutledge is a small private liberal arts school located...
-
5. WORK HEALTH & SAFETY Provide at least three types of hazards, corresponding risks, rating and control measures. Risk Rating (Low/Medium/High) Control measures (Current/Required)
-
Tanner Manufacturing is developing an activity-based costing system to improve overhead cost allocation. One of the first steps in developing the system is to classify the costs of performing...
-
Discuss the priority system a venue manager uses to book a 20,000-seat arena, a 2,500-seat theater, or a 500,000 sq. ft. meeting and convention venue.
-
From a criminal justice administration perspective, discuss how changes to organizational missions in the twenty-first century, have altered organizational structures and constituencies in such a way...
-
Josh and Nancy are at Coachella. They made plans to meet up after Flume's set, but for now, they're both watching Muse at the main stage, but from different locations. At Nancy's location the music...
-
Brazil - describe the country. You will need to discuss culture, how a eco friendly cleaning product will fit and why you think it could possibly sell there. Note the currency of the country and the...
-
In pairs or small groups, discuss the following: Thinking about your own abilities, where do you see yourself in Belbin's model? Are there areas you would not be comfortable in? What could you do to...
-
Using the decision-making biases listed (anchoring, framing, recency). Discuss the types of decisions where you are likely to be most rational.
-
Suppose ABC Telecom Inc.s CFO is evaluating a project with the following cash inflows. She does not know the projects initial cost; however, she does know that the projects regular payback period is...
-
Which of the following is NOT a magnetic dipole when viewed from far away? a) A permanent bar magnet. b) Several circular loops of wire closely stacked together with the same current running in each...
-
Establishing materiality and allocation of materiality to individual accounts requires considerable judgment. Access Microsofts 2009 financial statements at www.microsoft.com (use the investor...
-
Explain why the emphasis in auditing property, plant, and equipment is on the current period acquisitions and disposals rather than on the balances in the account carried forward from the preceding...
-
You go through the drive-through window of a fast food restaurant and notice a sign that reads "your meal is free if we fail to give you a receipt." Why would the restaurant post this sign?
-
For several years, the Otis Capital USA Corp has been exploring for gold on its mining claims held on public lands near the Idaho-Montana border. Otis filed a proposal to expand its current...
-
When GTE Sylvania discovered it was losing market share to other television manufacturers, it developed a franchise plan that limited the number of retailers selling its product in each area....
-
Visa, MasterCard, American Express, and Discover control practically all credit card transactions in the United States. The credit card industry is a two-sided market; that is, cardholders benefit...
Study smarter with the SolutionInn App