Write a program that will provide data for a meaningful comparison of sorting algorithms. You will include the following algorithms in your program (each as an individual method or methods):
- Selection Sort
- Insertion Sort
- Bubble Sort
- Shell Sort
- Quick Sort
You may sort any data type you prefer, but integers are acceptable for this assignment.
For each sorting algorithm, you will collect data on the efficiency of the algorithm. A simple way to accomplish this is to use a timer. As with any data gathering exercise, it is necessary to perform multiple tests on varied data. You will perform each test at least 100 times, using a randomly generated data set each time.
You will also compare the effect that the size of the data set has on performance. Create data sets that have 10, 100, 1000, and 10000 elements (a more flexible program would allow the user to specify parameters for building the data sets, number of runs using each set, etc.).
It is not necessary to automate this second component, although it is certainly possible. You may also collect and record this information by hand and compile it into a written report.
Once complete, your program will present results in a meaningful and organized way to the user. You might perform an analysis of your results using graphing technology.
Comments (0)
You don't have permission to comment on this page.