Question: Implement a C# application to sort 'N' randomly generated numbers using Rank sort. The Program should use following three design techniques: a) Serial (single


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.
Step by Step Solution
3.52 Rating (159 Votes )
There are 3 Steps involved in it
using System using SystemDiagnostics using SystemThreading class Program static void Main int sizes 100 500 1000 2000 5000 10000 20000 50000 100000 ConsoleWriteLineSizetSerial TimetMultithreaded Timet... View full answer
Get step-by-step solutions from verified subject matter experts
