Question
This question asks about complexity analysis and big-oh notation. Please consider the following C# method. public float FindMystery(float[] array) { float result = 0; for
This question asks about complexity analysis and big-oh notation. Please consider the following C# method. public float FindMystery(float[] array) { float result = 0; for (int i = 0; i < array.Length; i++) { if (array[i] > result) { result = array[i]; } } return result; } a) If a is the array {101, 19, 102, 20}, what is the result of the method call: FindMystery(a)? b) What is the worst-case time complexity in big-oh notation of the FindMystery() method? c) Please describe, in words, under which circumstances the FindMystery() method achieves its best-case and worst-case runtime. d) What is the best-case time complexity in big-oh notation of the FindMystery() method?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started