Starting from:

$30

CSE204-Mergesort & Quicksort-Solved


Task 1: Implementation  
1.      You have to implement Merge Sort and Quicksort  

2.      You are given a cpp file sortarray.cpp​       

3.      Generate arrays in ascending, descending and random order.

4.      Populate the array of size n by generating random integers

5.      Apply merge sort and quicksort to sort the array

6.      Record the time to accomplish each sorting

7.      Finally print the array

 
n =  
10
100
1000
10000
100000
1000000
Case 
Sort 
ascendi ng
merge
 
quick

descend

ing
merge

quick
 
random
merge
 
quick

8.      Each generation process should generate an entirely new array

9.      Your implementation must be memory efficient

Task 2: Statistics generation
10.  Create another file statistics.cpp​     

11.  Vary array size from 10 to 1000000. You can increase the upper range if that gives you better statistics.

12.  Generate in ascending, descending and random order, sort them by merge sort and quick sort and record the timing in the following table.

13.  For example: You want to get timing for n=10, ascending with merge sorting. Generate the scenario multiple times and take the average sorting time. Record only the average sorting time into the cell.

14.  Plot running time of both the sorting algorithm against the input array size n for best, worst and average case.

More products