Question: Language choices: C++ or Java The purpose of the programming assignment is to perform empirical analysis of the following sorting algorithms on integer arrays: selection

Language choices: C++ or Java

The purpose of the programming assignment is to perform empirical analysis of the following sorting algorithms on integer arrays:

  1. selection sort;
  2. insertion sort;
  3. two versions of a bubble sort: with and without counting the number of swaps on each pass through an array;
  4. quicksort;
  5. mergesort.

Requirements:

- Functions from standard libraries implementing sorting algorithms are NOT allowed; however, you can use any code from any other sources with proper references.

- Obtain the working time of each algorithm for a particular array; call this function (to calculate working time) before and after a call to the function implementing a sorting algorithm.

- Run your functions for the following types of arrays containing: 1000, 10000, and 100000 integers: random numbers, sorted list, almost sorted list, in which every 10th number is out of order (random number).

- Size of integers is supposed to be from 1 to 1000.

- **Submit: Source code with the results, and summarize the efficiency of each sorting algorithm (selection sort, insertion sort, bubble sort (with and without counting number of swaps), quicksort, mergesort). Also, summarize which sorting algorithm work better for specific types of input.

- Do NOT include original and sorted arrays in your output.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!