CIS-3050 Homework #3: QuickSort

Due: Wednesday, September 14, 2016

Study the way MergeSort was converted from pseudo-code to a working C implementation. You will be doing something similar for this assignment.

  1. Modify Sorters.h to include the following declaration of QuickSort:

            void quick_sort( void *first, size_t element_count, size_t element_size, int( *compare )( void *, void * ) );
          
  2. Implement this function in Sorters.cpp. Follow the QuickSort pseudo-code developed in class.

  3. In the UnitTests project modify the file SortersTests.cpp to add new tests for QuickSort. You can copy the MergeSort tests and make a few adjustments. Be careful to tweak your implementation of QuickSort so that the test cases are not considered "trivial." Alternatively you could add some larger test cases. Verify that the tests pass.

Submit your file Sorters.cpp to Moodle.


Last Revised: 2016-09-06
© Copyright 2016 by Peter C. Chapin <PChapin@vtc.vsc.edu>