Question: 2. (2 points) There is an array of n distinct elements. You are not given any further information about the array. Here are 2 ways

 2. (2 points) There is an array of n distinct elements.

2. (2 points) There is an array of n distinct elements. You are not given any further information about the array. Here are 2 ways that are proposed in order to find the minimum element. Then analyze the run time of both of them. From a big-O perspective which one is better? Use recursion, attempt 1. min Elem(array) = min(min Elem(firsthalf), min Elem(rest)) array[0] if n > 1 if n=1 Use recursion in a different manner minElem(array) = min(array[0], min Elem(everything but the first element)) if n > 1 array[o if n=1

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!