COMP20290 - Sorting Assignment
COMP20290 - Sorting Assignment
Instructions
This is a GRADED assignment and requires a submission to Brightspace.
Submission Instructions
Your submission to Brightspace should consist of a single file called Sorting.java . There should not
be a package statement at top of the file. We will be using our own version of the SortingTest.java
to test your code. It is your responsibility to ensure that your submission works for the original
SortingTest.java file given to you.
Should you require to submit this assignment late please send an email to the TA
([email protected]) and module coordinator ([email protected]) in due time.
Assignment
Provided in the assignment are two java files, Sorting.java and SortingTest.java . You will have to
set up your project to correctly run the test file. For testing you will need to add JUnit4 to your project.
You do not need to modify the contents of SortingTest.java , you can do so during testing, but
again we will not be using your version of the test file.
The Sorting.java file contains skeleton code for the sorting methods that you will need to
implement. For each sorting algorithm you are expected to provide the theoretical, best, worst and
average time complexity in Big O notation, as well as providing an explanation as to how each of
those time complexities were determined. This information should be provided in the form of a
comment or javadoc on one either the list version or array version of each algorithm.
Please ensure to comment your code when necessary and to format it in accordance to the Java style
guide.
Provide the theoretical, best, worst and average time complexity in Big O notation, as well as
providing an explanation as to how each of those time complexities were determined.
2. Quicksort (45% - 25% Implementation - 15% for complexities
(5% each) - 5% Theory questions)
Implement the Quicksort algorithm for both generic lists and generic arrays
Provide the theoretical, best, worst and average time complexity in Big O notation, as well as
providing an explanation as to how each of those time complexities were determined.
Provide four potential decisions/optimizations that can be made to the base Quicksort algorithm.
Explain each one provided.