Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the first image is of the assignment i have to complete. the second image is over my assignment #3 to base off of for the

the first image is of the assignment i have to complete. the second image is over my assignment #3 to base off of for the lists. im just confused as to what this is asking me to do. language is Python. image text in transcribed
image text in transcribed
Overview Modify your HW\#3 code, which contains your Insertion Sort implementation and your method to verify if a list is sorted, and extend this code in the following ways: 1. Print out your name and date 2. Set up your code to iterate over a number of different problem sizes N=[128,256,512,1024,2048,4096,8192,16384]. 3. For each problem size: use a List Comprehension formulation to generate a list of length N containing random numbers in the range [0.9999] using a hard-coded random seed. 4. Invoke your check sort() function from HW\#3 to check the sorted status of the list, and print the return status from your check sort() function. 5. Measure the elapsed time to sort these numbers using your Insertion Sort function from HW\#3. 6. Verify the correctness of your sort by invoking your check_sort() function from HW\# 3 and printing the return status from your check_sort() function. 7. Create a plot using matplotlib showing elapsed time (sec) vs problem size. Your plot needs to contains a title for the overall plot, and meaningful x - and y-axis labels. Dinuts: Neyboarey console trput from user dutputse petate dut ourhint date+t fa and a Lift Dependepciest inports from the bythar tire modile wis rendon podule in ityert - isport tulie and sepert randos modelen iport tine Ihorit randin Z print nase print ( Mebered sen4 ) E printi purnent drte and tike print("the current time fit" , time asctine(3) def hou tont is the line( L,A. ) : for 4 in rarite(Iest(b)) i 1f(x+1)x,A=t)t print(in) A groapts iser for number; of elogentes in 11 st [wi] seint(1nput ("enter soed valiee fo engin fandarifatlan:")) - far in range(n): randor. seod (5) - for j in range {n}i L. aepend(randos. randint (9,99)} * function to do iusertion nort def sartmltut(t); - if(nt=len(L))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago