Question: algorithms 4. Answer the following: a. Give an algorithm to find the max element value in an array of integers. What is the running time
4. Answer the following: a. Give an algorithm to find the max element value in an array of integers. What is the running time of your algorithm? b. Assume now that the array is presorted. Could you improve the running time of algorithm? If yes, give an improved algorithm. What is the running time of your algorithm now? C. Give an algorithm to find the index position of the first occurrence of the max element value in the array. What is the running time of your algorithm? d. Will binary search improve the runtime of finding the max element index position
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
