CS311 Project 3: Heap Sort

Due Monday, April 22

Write a template function (not class) that will sort an array in-place using heapsort. Feel free to borrow anything you like from our class example, but do remember that instead of a heap ADT, this will be a function that performs heapsort. The prototype for the function should be:
template\
void heapsort(T *array, size_t arraylength);
		
For convenience of use, minimize operator diversity by only using assignment, greater than, and equality. This way, if T is a user-defined class, the user only has to define two operators. Include a main function which tests sorting on at least two different types of array.

Extra credit option (20% bonus)

In addition to the heapsort function above, create another heapsort function that does not use a template, can be compiled using C (not C++), and matches the parameters for the library function qsort, but uses heapsort instead. Run "man qsort" for an explanation of the qsort function.

Turning in the project

Upload the assignment here