60 60 votes 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 \times M_2$ will be 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 Algorithms gatecse-2004 algorithms time-complexity easy + – Kathleen 21.1k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
0 0 votes Answer:independent of the storage schemeHere they mention that they use the array container,which take O(1) time complexity to get and set the element, so it doesn't influence the matrix multiplication whether if we arrange in row or colum major as we can acess it instantly where ever they are .The time complexity change, if we change the algorithm we follow or if we used another container like linked list which take O(n) for lookup. Charankurva answered Jun 5 Charankurva comment Share Follow 0 reply Please log in or register to add a comment.