Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***In JAVA*** The sorting algorithms that will be examined are: Selection sort Insertion sort Merge sort Quick Sort All sorting algorithms must sort the arrays

***In JAVA***The sorting algorithms that will be examined are:

  1. Selection sort
  2. Insertion sort
  3. Merge sort
  4. Quick Sort

All sorting algorithms must sort the arrays in ascending order.

Each sorting and searching algorithm will be comparatively run on arrays of the following sizes:

  1. fifty (50)
  2. one thousand (1,000)
  3. ten thousand (10,000)
  4. one hundred thousand (100,000)
  5. one million (1,000,000)

Each sort is to be tested on the same data set to strive for some consistency.

Sorting Methodology and Requirements:

  1. Create a core data set called coreData which must be a single array of size one million (1,000,000) integers filled with random numbers between one (1) and three million (3,000,000).
  2. For each comparative test, four (4) copies (one for each sort to be tested) consisting of the same data from coreData must be made. For example, if the comparative test is on one thousand (1,000) elements, four arrays of size (1000) should be made and filled with a copy of the first one thousand (1000) elements of coreData.

All recorded times must be measured using System.nanoTime() for best accuracy. An example of how to use it is given below.

long start = System.nanoTime();

//code to be tested

long end = System.nanoTime();

long timeTaken = end start;

The unit for printing the time must be done according to the following table:

Test data size

Time unit

50

nanoseconds

1,000

nanoseconds

10,000

nanoseconds

100,000

nanoseconds

1,000,000

millisecond

Output requirements:

The name of each sorting algorithm tested and the time it took to sort the data must be shown grouped by the test data size. For a test data size of fifty (50), the time taken for all the sorting algorithms to sort the data must be shown one after another.

Fill in the tables below with the results of your tests such as Selection sorts, Insertion sorts, Merge sorts and Quick sorts

Number of Items

Selection Sort

50

1,000

10,000

100,000

1,000,000

Run 1

Run 2

Run 3

Run 4

Run 5

Average

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

What is meant by 'Wealth Maximization ' ?

Answered: 1 week ago