Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Weighting: 15%
Overview
This purpose of this assignment is for you to become familiar with understanding sorting algorithms and linear data
structures, and to investigate using experimental analysis to measure the practical performance of different sorting
algorithms.
Marks
This assignment is worth 15% of your total grade. COMP3506 students will be marked on questions 1 to 3 out of
55 marks. COMP7505 are required to additionally do question 4 and will be marked out of 70 marks.
Submission Instructions
Your solutions to Q1 will be submitted via Gradescope to the Homework 2 - Question 1 submission. You
should only submit your completed SortingAlgorithms.java file.
Your solutions to Q2 will be submitted via Gradescope to the Homework 2 - Question 2 submission. You
should submit your answer as a pdf file.
Your solutions to Q3 will be submitted via Gradescope to the Homework 2 - Question 3 submission. You
should only submit your completed SimpleArrayDeque.java, SimpleLinkedDeque.java, ReversibleDeque.java
files.
(COMP7505) Your solutions to Q4 will be submitted via Gradescope to the Homework 2 - Question 4
submission. You should submit your answer as a pdf file.
No marks will be awarded for non-compiling submissions, or submissions which import non-supported 3rd
party libraries. You should follow all constraints laid out in the relevant questions.
Hand-written answers for questions 2 and 4 will not be marked.
Late Submissions and Extensions
Late submissions will not be accepted. It is your responsibility to ensure you have submitted your work well in
advance of the deadline (taking into account the possibility of internet or Gradescope issues). Only the latest
submission before the deadline will be marked. See the ECP for information about extensions.
Academic Misconduct
This assignment is an individual assignment. Posting questions or copying answers from the internet is considered
cheating, as is sharing your answers with classmates. All your work (including code) will be analysed by
sophisticated plagiarism detection software. Students are reminded of the University’s policy on student misconduct,
including plagiarism.
itee-student-misconduct-including-plagiarism.
Support Files Provided
The following support files are provided to you:
SortingAlgorithms.java - you need to implement your question 1 sorting algorithms in this file.
SimpleDeque.java - an interface used for question 3.
SimpleArrayDeque.java - you need to implement question 3(a) in this file.
SimpleLinkedDeque.java - you need to implement question 3(b) in this file.
ReversibleDeque.java - you need to implement question 3(c) in this file.
Questions
1. (20 marks) Implement the following sorting algorithms in SortingAlgorithms.java as they have been described
in lectures and tutorials.
Selection Sort (in the selectionSort method)
Insertion Sort (in the insertionSort method)
Merge Sort (in the mergeSort method)
Quicksort (in the quickSort method), using the median element at bn/2c as your pivot.
A stub has been provided in SortingAlgorithms.java. Each algorithm needs to be able to sort arbitrary
Comparable1 objects and should be able to sort in descending order with the reversed flag.