Question: Use Python programming language (the assigment #3 code is provided below) Create a Python program that will measure the execution time of your Bubble Sort

Use Python programming language (the assigment #3 code is provided below)  Use Python programming language (the assigment #3 code is provided below)
Create a Python program that will measure the execution time of your

Create a Python program that will measure the execution time of your Bubble Sort code for varying problem sizes, and then plots the performance results using Python's matplotlib.pyplot module. Your code must contain two new Python Functions: (1) contains your Bubble Sort code from Assignment #3, and (2) tests if a Python List is sorted in ascending order and returns True if so or False otherwise. Use Python's time module to obtain time values for the purposes of computing elapsed time. from datetime import datetime import random bubble sort method which sort the 1st in ascending order def bubbleSort (1st): s = len(1st) for i in range(S-1): for j in range(0,s-i-1): if(sttil > Ist[j+1]): 1st [31, 1st[i+1] - 1st [j+1], 1st[3 display method to show the content of list 10 numbers per line def display (1st): i - 0 while(iN): break print() print your name print("your name") #print todays date and time date - datetime.now().strftime("8d-8m-1Y 28: 8M:&S") print (date) take input for N N = int(input("Enter N: )) take input for s s = int(input("Enter S: )) seed random with s random.seed(s) make a empty list 1st-01 append list with random number for i in range(N): 1st.append(int (random.random()*100)) * print unsorted array print("Unsorted array: ") display(1st) sort the list bubbleSort (1st) print unsorted array print(" Sorted array:") display (1st)

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!