Answer: Hello your question is poorly written attached below is the well written question
answer:
a) Determine ( compute ) the difference between the max and minimum value. determine the Min and max values using 1.5n comparisons
time efficiency = θ( n )
b) A(n-1) - A(0)
time efficiency = θ( 1 )
Explanation:
a) An unsorted array
To find the maximum and minimum values scan the array of elements , then determine ( compute ) the difference between the max and minimum value. to determine the range. Alternatively determine the Min and max values using 1.5n comparisons
Algorithm's time efficiency = θ( n )
b) A sorted array
To determine the range, we will determine the difference between the first and last element i.e. A(n-1) - A(0)
time efficiency = θ( 1 )
answer:
1.The program comes to a line of code containing a "function call".
2.The program enters the function (starts at the first line in the function code).
3.All instructions inside of the function are executed from top to bottom.
4.The program leaves the function and goes back to where it started from.
5.Any data computed and RETURNED by the function is used in place of the function in the original line of code.