Question: In the algorithmic study, we often use the Big-O notation to describe the growth of each computer algorithm. Therefore, you will be required to measure

In the algorithmic study, we often use the Big-O notation to describe the growth of each computer algorithm.

Therefore, you will be required to measure the starting time and the ending time of a function call. Each function will be an example sorting algorithm implementation.

For instance,

random_list_10_elements = generate_random(10)

start_time = measure_of_system_time()

sorted_list_10_elements = selection_sort(random_list_10_elements)

end_time = measure_of_system_time()

time_selection_sort_10_elements = end_time start_time

This is the pseudo-code for the performance measurement of selection sort over 10 elements.

To generate the 10-elements, please use random number generator which can generate number in the range of (0 <= x < 105), for each x element generated.

Please measure each sorting algorithm for 10, 100, 1000, 10000, 100000. At least these 5 cases.

All sorting results should be in ascending order. Duplicated elements are allowed.

Each sorting test case must have newly generated random elements.

Please measure for the following 5 sorting algorithms:

Selection Sort, Insertion Sort, Bubble Sort, Merge Sort, Quick Sort.

So, totally there are 25 test cases to be measured.

(Please write this code for python!!! And please show the output on your end to ensure it works!!!)

Using a log-log chart can show the growth better than the linear scale in this case. You must complete all 5 sorts.

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!