Homework 4, O(n log n) sort comparison.

Short Description:

Investigate the wall clock performance time of quick and heap sort.

Goals

When you finish this homework, you should have:

Formal Description

For this homework you need to compare the actual performance of heap and quick sort. Implement these sorts and use the framework from the previous homework to test the timing performance of these sorts sort. Please feel free to use some or all of this code. Coding is not the challenge of this exercise, the analysis of the results is. If you wish, I will discuss this code in class, just ask.

After you have implemented these algorithms, perform a series of timing experiments, counting the number of comparisons, data moves and total time spent in each sort. You need to carefully select the sorting values and the number of elements for to make your experiment valid. However, please perform the LAST value set from the previous assignment (10,000 elements between [0 to 1,000,000]) so that you can perform part of the report.

Produce a table for your two sorts that presents the average time, comparisons and data moves for each different array size. Produce several graphical depictions of this table. I would use excel and generate a pivot table to do this. If you need assistance, please ask.

Write a report describing your findings and interpreting the results. Your report should follow the IMRD format

Please note, your discussion must include at least one graph, table and a discussion comparing these sorts to the sorts in the last assignment.

Notes

Please do not optimize your code, of if you do, include a presentation of non-optimized results as well. Code is optimized with any of the following flags: -O1, -O2, -O3, -Os, -Ofast -Og, -Oz. Generally we turn optimization on to help detect uninitialized variables.

You may use components of the standard library, my framework relies on these heavily. You must, however, implement the sorting algorithms yourself.

I encourage you to use the chronos library for time and the random library for random number generation. You may use my framework and are excused from deep knowledge of these libraries.

  • If you wish, my Makefile is here.

    Required Files

    A zip or tar file containing

    Submission

    Submit the assignment to the D2L folder Homework 4 by the due date.