Question

Implement and compare sorting algorithms. The task is to sort a list of integers using 5...

Implement and compare sorting algorithms. The task is to sort a list of integers using 5 sorting algorithms:

selection sort

insertion sort

merge sort

heap sort

quicksort

Your program should include 5 separate sorting methods, though it is fine for them to call some common methods (like "swap") if needed. Each sorting method should also count the number of comparison operations and assignment operations on the array elements during the sorting process.

In the main program, two types of array will be used to test the methods: "short" arrays of length 50 and "long" arrays of length 2000. For each of the two types, the main program should generate 100 arrays containing random elements, and use the 5 sorting methods on copies of the same array. The results should be checked to make sure the arrays are correctly sorted, though it is not necessary to include all the input and output data in the final result.

The final result of the program should be a 5-by-4 (or 4-by-5) table, where each row (or column) is for a sorting algorithm, and the columns (or rows) should be for "comparison/short", "comparison/long", "assignment/short", and "assignment/long". The value in each cell of the table should be the corresponding average value of the 100 testing arrays.

Finally, write a brief report to compare the efficiency of the algorithms according to the testing results.

This assignment should be programmed in Java!

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Implement and compare sorting algorithms. The task is to sort a list of integers using 5...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT