Programming Assignment #4
COSC 311

PLEASE NOTE: The end of the semester is upon us. No late programs will be accepted.


What to do:

Implement QuickSort, HeapSort and MergeSort assuming array of integers.


I have provided 3 data files. Each contains 10,000 integers. One file is in ascending order, one in descending and one is random. In each case, you must read the data into an array.
After data is read into the array, turn on a timer, and time your algorithm until sorting is complete. Your program should provide elapsed time for sorting, and then **write** the data out to disk (for inspection). We repeat for emphasis: OUTPUT FROM EACH PROGRAM MUST BE TO DISK SO IT CAN BE INSPECTED. YOUR PRORGAM SHOULD PROMPT THE USER FOR THE NAME OF AN OUTPUT FILE AND YOUR PROGRAM SHOULD USE THIS FILE.


Ascending Data

Random Data

Descending Data


What to hand in:
- a listing of your program
- a table summarizing the actual run times of the three algorithms on all three data sets, as in:

                        QuickSort        HeapSort        MergeSort
Ascending        xxx                    xxx                xxx
Random            yyy                    yyy                yyy
Descending       zzz                     zzz                zzz