###### Question 9517 – Time-Complexity

February 13, 2024###### Question 9570 – Time-Complexity

February 13, 2024# Question 9527 – Time-Complexity

Two matrices M_{1} and M_{2} are to be stored in arrays A and B respectively. Each array can be stored either in row-major or column-major order in contiguous memory locations. The time complexity of an algorithm to compute M_{1} × M_{2} will be

Correct Answer: D

Question 20 Explanation:

Running time of an algorithm is always independent of the storage scheme. While computing the running time of an algorithm we assume that to access any element time taken is same. So answer is (D).

But if the question would have asked best time complexity in which of the following implementation (not algorithm) then Option (A) is correct.

But if the question would have asked best time complexity in which of the following implementation (not algorithm) then Option (A) is correct.

best if A is in row-major, and B is in column major order

best if both are in row-major order

best if both are in column-major order

independent of the storage scheme

Subscribe

Login

0 Comments