This project is designed to give you practice using recursion to solve problems object-oriented way, and with reworking existing code.
Modify your mergesort code from the
Mergesort project
to now include both mergesort and recursive quicksort methods. In
addition to prompting for an input text file, the program should prompt
the user for which sort to use, and use the chosen sort. The main part
of the program should read in the data to create the array, then call
another object to actually execute the sorting routines, passing the
array to be sorted as a parameter to the call. Any details of sorting
should be encapsulated
within this sorting object and its methods. Once the sort is completed,
the main program should write the sorted array out to a text file.
The recursive Quicksort algorithm is
described on pp. 721-722 of Horstmann.
The numbers to be sorted will be read in from an input text file of integers that will be
provided by your instructor, and the final output will be a
single file with all integers sorted.
You can assume:
A couple of things will tell you if you get things correctly separated and enapsulated: