You want to design an algorithm, called minMax(A,p,r), that takes an array of integers and indexes of the first and last elements, and returns the minimum and maximum values in that range.  Briefly describe a non-recusive algorithm (no pseudo code is needed) that does the task mentioned above with time complexity Θ(n).

icon
Related questions
Question

 

You want to design an algorithm, called minMax(A,p,r), that takes an array of integers and indexes of the first and last elements, and returns the minimum and maximum values in that range.

  1.  Briefly describe a non-recusive algorithm (no pseudo code is needed) that does the task mentioned above with time complexity Θ(n).

(Short answer please)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer