Question: Consider the following algorithm: Algorithm mysterious(A[O..n 1]) //Input: Array AO..n 1] of numbers //Output: ????????????? ?????????? x=0 for in 0 to n - 1 do

 Consider the following algorithm: Algorithm mysterious(A[O..n 1]) //Input: Array AO..n 1]

Consider the following algorithm: Algorithm mysterious(A[O..n 1]) //Input: Array AO..n 1] of numbers //Output: ????????????? ?????????? x=0 for in 0 to n - 1 do for j - 0 to n - 1 do if # j and A[i] A[j]] > x - |A[i] A[j] return x X 1. What does this algorithm do? 2. Improve the algorithm by modifying the inner loop and its body. 3. Propose another better algorithm to solve the

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!