Question: 6. [10 pts] Programming assignment: Insertion sort/Merge sort Write a program to implement Insertion sort and Merge sort to sort an array Input array should

6. [10 pts] Programming assignment: Insertion sort/Merge sort

Write a program to implement Insertion sort and Merge sort to sort an array

Input array should be at size of 10, 50, 100, 300, 500, 1000, 2000, 5000, 10000, 50000 for integer numbers that are not sorted at all.

use a pseudo random number generator function to generate an input array

Use any language and environment of your choice, such as C++, Java, or Python. However, C++ and Qt is a recommended choice. If you use Qt, you can use QtChart to draw the graph and compare the execution time for both algorithms. See the sample code SortChart.zip in Canvas as an example of using QtChart.

(x-axis = input size n, and y-axis = the running time (ms))..

Conclude what you observe and justify your answer.

Submit the source code, output chart(s) and your observation and conclusion.

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!