Quicksort

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:

  1. The main code is mostly control flow code, and all the details are in other objects.
  2. It is easy to separate things like reading the data in from sorting the data, so that
    you can test the sorting code separately from the code that creates your array.
    For example, I might want to hard-code a test array to check my sort routines, rather
    than reading them from a file, as part of one test.
  3. Code is clear and easy to read, mostly self-documenting.


Things to think about