Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

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

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

Explain your experience with WordPress and BuddyPress?

Answered: 1 week ago