a) Write an algorithm that finds the largest element in an array of n elements, denoted by A [1…n],…

Question:

Transcribed Image Text:

a)

Write an algorithm that finds the largest element in an array of n elements,

denoted by A [1…n], using divide-and- conqueror algorithm design pattern. Assume

that the original array is divided into two equal subarrays (3 pts).

Hint: Complete the following skeleton of the algorithm by adding its appropriate

algorithms and body.

int maximum (—

{

}

b)

If your algorithm has every-case time complexity, what is the every-case time

complexity of your algorithm. Show all the necessary steps(1pts)

c) If your algorithm has no every-case time complexity, what is the worst-case and best-lows

case time complexities of your algorithm. Show all the necessary steps(2pts) to Settings to activate V

Expert Answer:

Answer rating: 100% (QA)

Here s the algorithm to find the largest element using divide and conquer a Algorithm python def max

View the full answer