CS 415, Section 002 Sonoma State University Spring, 2022
 
Algorithm Analysis
Instructor: Henry M. Walker

Lecturer, Sonoma State University
Professor Emeritus of Computer Science and Mathematics, Grinnell College

Comparison of Sorting Algorithms

This problem asks you compare the performance of six sorting algorithms, including:

In developing the comparison, you will need to code each algorithm in C or C++; and you will need to run all algorithms on the same data sets of varying sizes. Here are some details.

Collaboration and Academic Honesty Certification

Altlhough collaboration is allowed on this programming exercise, all outside sources and collaborators MUST be cited. Further, over 40% of the code and write-up submitted must be your own. You can talk to others, but you need to do a substantial part of the coding and write-up. Toward that end, the following must be included at the start of your program.

/**********************************************************************
* Name:                                                               *
* Assignment name:  Comparison of Sorts                               *
* Assignment for <due date>                                           *
***********************************************************************/

/**********************************************************************
* Academic honesty certification:                                     *
*   Written/online sources used:                                      *
*     Program sort-comparisons.c by henry m Walker from CS 415 Lab    * 
*     [include textbook(s), CS 415 labs or readings;                  *
*       complete citations for Web or other written sources]          *
*   Help obtained                                                     *
*     [indicate names of instructor, class mentors                    *
*      or evening tutors, consulted according to class policy;        *
*      write "none" if none of these sources used]                    *
*   My signature below confirms that the above list of sources        *
*   is complete AND that I have not talked to anyone else             *
*   (e.g., CSC 415 students) about the solution to this problem       *
*                                                                     *
*   Signature:                                                        *
***********************************************************************/

Additional Instructions

Once you have the times collected for the various algorithms, plot the times versus the data set size using any graphing software you wish. (A spreadsheet might be used, but you also might use MatLab, Maple, or other package.) For each algorithm, the times for the three data sets should be connected (that is, one line would connect the times for the insertion sort with ascending data against sizes 10000, 20000, 40000, ... .)

If the graphing software allows, it would be helpful to have the graphs for all algorithms with ascending order combined on one plot, the graphs for all algorithms with random data on a second plot, and the graphs for all algorithms with descending data on a third plot. In addition, a graph of a line (f(n)=n) and a quadratic (f(n) = n2) would be helpful (but not required).

Notes: Much code is available from textbooks and online sources for many of these algorithms.