| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Assignment - Compare Sorting Algorithms

Page history last edited by Steve Sweeney 13 years, 11 months ago

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):

  1. Selection Sort
  2. Insertion Sort
  3. Bubble Sort
  4. Shell Sort
  5. 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.