Instructions Comparison of SORT algorithms The objective of this Assignment is to compa
Instructions
Comparison of SORT algorithms
The objective of this Assignment is to compare the performance of some standard SORT algorithms.
You should look at MergeSort, QuickSort, (see attached code) and Selection Sort (from Week 2); you can also look at an additional Sort mechanism that isn't covered in class or that isn't covered in the book for extra credit. OR you can find an implmentation of Radix Sort.
You will have to find the right implementation in Java so that you can make your comparisons for the 4th algorithm (if you choose to go for the extra credit).
Things you will be comparing are the raw running time (measured with Java time functionality) and the time complexity (iteration count) in terms of a key operation for the algorithms (ex: as we discussed in class for Selection Sort comparisons are often a good way of measuring the time complexity of sort algorithms), for this purpose you'll have to use meaningful count variables.
Refer to https://docs.oracle.com/javase/7/docs/api/java/lang/System.html for time methods.
Use:
https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis()
or
https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#nanoTime()
as you see fit.
Testing:
When comparing algorithms you want to make sure that you use a wide variety of test cases. In your case, you should have at least 4 different example sets on which to run your tests, each test case should have at least 20 numbers.
Report:
If you chose a 4th algorithm for extra credit, discuss which is the 4th algorithm and why you chose that.
You must have MergeSort, QuickSort, and Selection Sort.
Discuss your plan for testing. Explain the 4 test cases that you chose and explain briefly why you chose those test cases. Test cases must have at least 50 integers or more.
Summarize your results for both measured running time and time complexity.
Describe your conclusions including insights, and surprises if any. How does the measured time complexity compare with the expected O cost?
Grading:
1. Test plan and code implementation: 50 points
2. Report and results: 40 points
3. What is the sorting mechanism that Arrays.sort() uses? How does that compare with the others? 10 points
4. Extra credit: up to 20 points
MAKE SURE TO USE TEAMS for discussion and to clear doubts.
You can either use the class attached or you can copy and paste into separate classes.
Additional resources for assignment
- Sorter.java ( 5 KB; Mar 23, 2021 9:51 pm )
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.