Question: Run the Insertion Sort algorithm twice: once with an array of length 1 , 0 0 0 and once with an array of length 1

Run the Insertion Sort algorithm twice: once with an array of length 1,000 and once with an array of length 10,000.
To do this, go to line 17 of the code and update the array for each test run as follows:
arr =[random.randint(1,10000) for _ in range(1000)]
arr =[random.randint(1,10000) for _ in range(10000)]
What is the execution time for the 1,000-element array?
What is the execution time for the 10,000-element array?

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!