Question: Assignment Instructions: Code This For the first part of the assignment, you will be conducting an experimental analysis of three different sorting algorithms. One of

Assignment Instructions: Code This
For the first part of the assignment, you will be conducting an experimental analysis of three different sorting algorithms. One of these will be Python's built-in sort function, and the others are implementations of bubble sort and merge sort, for which the code is provided below:
def bubble_sort(seq):
for i in range(len(seq)):
for j in range(len(seq)- i -1):
if seq[j +1]< seq[j]:
seq[j], seq[j+1]= seq[j+1], seq[j]
def merge_sort(seq):c
if len(seq)<=1:
return
left = seq[0:len(seq)//2]
right = seq[len(seq)//2:len(seq)]
merge_sort(left)
merge_sort(right)
l =0
r =0
while l + r < len(seq):
if r == len(right) or (l < len(left) and left[l]< right[r]):
seq[l + r]= left[l]
l +=1
else:
seq[l + r]= right[r]
r +=1
Create a script file called ExprimentalAnalysis.py that contains code to test the performance of the different sorting algorithms. You should use Python's built-in time module and time function to help you determine the performance of the different algorithms. To do this, you will be creating lists of various sizes that contain random numbers in the range 09,999,999. When timing the algorithms, make sure that you're only measuring the amount of time taking to sort the list and do not include the time taken to generate the list.
To ensure that you get a more accurate result, it will be necessary for you to perform multiple runs for each of different algorithms. Depending on the particular test and the computer that you're using to run it, you can expect the test to take several minutes to complete You can use the tables below to record the amount of time that each run takes. You should comment out test code that you're not actively running (or put that code in a separate function) instead of deleting it. When submitting the assignment you should include the results as part of the Blackboard submission.
Tables for Test Results:
Bubble Sort Function 1,00010,000100,000
Run 1
Run 2
Run 3
Run 4
Run 5
Average:
Merge Sort Function 10,000100,0001,000,000
Run 1
Run 2
Run 3
Run 4
Run 5
Average:
Built-in Sort Function 100,0001,000,00010,000,000
Run 1
Run 2
Run 3
Run 4
Run 5
Average:

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 Programming Questions!