Question: How can I find time complexity (Big OH) in this code? (Code is the max value in an array using recursion) int maximum(int array[], int

How can I find time complexity (Big OH) in this code? (Code is the max value in an array using recursion)

int maximum(int array[], int index, int len) {

int max;

if(index >= len-2) {

if(array[index] > array[index + 1])

return array[index];

else

return array[index + 1]; }

max = maximum(array, index + 1, len);

if(array[index] > max)

return array[index];

else

return max; }

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!