Question: Consider the following algorithm: Algorithm Secret(A[0..n 1]) //Input: An array A[0..n 1] of n real numbers minvalA[0] maxvalA[0] for i 1 to n 1 do
Consider the following algorithm:
Algorithm Secret(A[0..n 1])
//Input: An array A[0..n 1] of n real numbers
minvalA[0]
maxvalA[0]
for i 1 to n 1 do
if A[i]< minval
minvalA[i]
if A[i]> maxval
maxvalA[i]
return maxval minval
a. What does this algorithm compute?
b. What is its basic operation?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
