Question: Topic: Algorithm Analysis nalysis 1. [40 points] Minimum in list algorithms - benchmark and plot Write two Python functions to find the minimum number in

 Topic: Algorithm Analysis nalysis 1. [40 points] Minimum in list algorithms

- benchmark and plot Write two Python functions to find the minimum

Topic: Algorithm Analysis nalysis 1. [40 points] Minimum in list algorithms - benchmark and plot Write two Python functions to find the minimum number in a list. The functions should take a random list of integers from 1 to 1000. The lists can be of size ranging from 1,000 to 20,000 integers, in increments of 2,,000. The functions should return the minimum number in the list. The first function, f_linear(), should do one pass through the list and be linear O(n). The second function, called f_quadratic(), should compare each number to every other number on the list using nested loops giving a complexity of O(n^2). [By the way this is not a good qilgorithm, but we are doing it to illustrate the Big-O concept] To save you some time here is one way to write this function: deff_quadratic(x): min = x[0] I = len(x) for i in range(1): for jin range(i+1,1); if x[i]

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!