Recursive Mergesort
This project is designed to give you practice using recursion to solve problems, and coding recursion in Java.
Goal: Code the recursive Mergesort algorithm described on pp. 715-718 of Horstmann. Give a pseudocode description of your code
as part of the Javadoc documentation for your project. If you look at, or use, any part of the code in your book, you must cite it clearly in your documentation.
You will sort numbers from an inputfile of integers (provided by your instructor), and the final output will be a single file with all integers sorted.
You can assume:
- all numbers can be held in memory at the same time (i.e. you have an array big enough to hold all the numbers in the input file at one time.
- you are not allowed to use the Java built-in mergesort
libraries.
- JUnit test code is not required for this project.
- Your code must sort any Comparable Object type, not just
integers. No credit will be given for code that does not sort Comparable objects.
Things to think about
- Never get far from something that runs, and works--compile
and run early and often.
- Develop the pieces incrementally, step-by-step.
- Take care to avoid infinite recursion--make sure the terminating conditions are clear and accurate.