Question: Use big-O notation to express the running time of test() on an array of length n. public void test( int array[]) { testR(array, 0, array.length-1);

  1. Use big-O notation to express the running time of test() on an array of length n. public void test(int array[]) { testR(array, 0, array.length-1);

}

public static void testR(int array[], int start, int end) { if (start == end) array[start]++; else { int mid = (end + start)/2; testR(array, start, mid); testR(array, mid+1, end); testR(array, mid+1, end); } }

please do give an indepth explanation with the notation as well. thank you

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!