Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Two matrices M1 and M2 are to be stored in ar... Start Learning for Free
Two matrices M1 and M2 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 M1 × M2 will be
  • a)
    best if A is in row-major, and B is in column- major order
  • b)
    best if both are in row-major order
  • c)
    best if both are in column-major order
  • d)
    independent of the storage scheme
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Two matrices M1 and M2 are to be stored in arrays A and B respectively...
This is a trick question. Note that the questions asks about time complexity, not time taken by the program. for time complexity, it doesn't matter how we store array elements, we always need to access same number of elements of M1 and M2 to multiply the matrices. It is always constant or O(1) time to do element access in arrays, the constants may differ for different schemes, but not the time complexity.
View all questions of this test
Most Upvoted Answer
Two matrices M1 and M2 are to be stored in arrays A and B respectively...
Explanation:
The time complexity of an algorithm to compute M1 M2 will not depend on the storage scheme used to store both the matrices. It will only depend on the size of the matrices and the algorithm used to perform the multiplication.

Reasoning:
The time complexity of matrix multiplication is O(n^3) using the standard algorithm. This algorithm can be used irrespective of the storage scheme used to store the matrices. Therefore, the time complexity of the algorithm will remain the same regardless of whether A and B are stored in row-major or column-major order.

Conclusion:
Thus, the time complexity of an algorithm to compute M1 M2 is independent of the storage scheme used to store the matrices.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer?
Question Description
Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer?.
Solutions for Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Two matrices M1 and M2 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 M1 × M2 will bea)best if A is in row-major, and B is in column- major orderb)best if both are in row-major orderc)best if both are in column-major orderd)independent of the storage schemeCorrect answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev