Java 18: Algorithms and data structures by Poul Klausen

Java 18: Algorithms and data structures by Poul Klausen

Author:Poul Klausen
Language: eng
Format: epub
Publisher: Bookboon.com Ltd.
Published: 2018-10-19T00:00:00+00:00


Here are partition() and pivot() the same methods that I looked at in the section about the median.

Problem 2: The sorting methods

In this task you should test the 6 sorting methods discussed in this chapter and compare them with the Java’s sorting method.

You must first check whether the 6 methods sorts correctly. That is, you must create an array that is not sorted and for each of the 6 sorting methods print this array, sort it and print it again.

Next, you must use each of the 6 methods and Java’s own sorting method to test how long it takes to sort an array of random integers.

The result could be as shown below:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.