Question

Question 4 CLO3 The following Python script implements an algorithm to find and prints the max value in a list of values. MAX
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The python script uses an iterative way to calculate the max value,
we iterate all the numbers in the list to find the max value in the given list

Answers:

a. Number of operation can be expressed as f(n) = n where n is the number of elements in the list


b. for n =10 the algorithm loops 10 times so the number of operations will be 10


c. the number of operation excluding the loop will be n since we are comparing n with max 'n' times


d. time complexity or Big(O) is Big(O)=n

Add a comment
Know the answer?
Add Answer to:
Question 4 CLO3 The following Python script implements an algorithm to find and prints the max value in a list of values. MAX 0 def MaxVal (Ist): for i in Ist: if( MAX < i): MAX = i return (MA...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT