Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following algorithm. ALGORITHM Enigma (A[0..n - 1, 0..n - 1])) for

ID: 3887424 • Letter: C

Question

Consider the following algorithm. ALGORITHM Enigma (A[0..n - 1, 0..n - 1])) for j = 0 to n - 2 do for k = j + 1 to n - 1 do if A[j, k} notequalto A [k, j] return false return true a. What does this algorithm compute? b. What is its basic operation? c. How many times is the basic operation executed? d. What is worst-case time complexity of this algorithm? e. Suggest an improvement or a better algorithm altogether and indicate its worst case time complexity. If you cannot do it, try to prove that in fact it cannot be done.

Explanation / Answer

a.check if the input matrix is symentric matrix or not if the matrix is symentric it return true else it return false

b. The basic operation is the comparison of the matrix elements. by the above method

c.Depending on the if the matrix is symentric or not the comparison is done In the best case the first comparison shows that the matrix is not symmetric so in the best case we have (1) efficiency class

d.. In the worst case we have to perform n 2/2 comparisons, so in the worst case we have (n 2 ) efficiency class.

e. we can try other ways to be the best way time complexity by various variation in the algorithm.