Sorting Algorithms
- Consider a matrix multiplication computation program C = B*(A+D) where A, B, C, and D are (nxn) two-dimensional matrices.
Ans => Time complexity ofmatrix addition A + D = O(n2)
Time complexity of matrix multiplication B*(A + D) =O(n3)
So, total complexity ofoperation C = B*(A + D) is
= O(n2) +O(n3)
=O(n3)
- The program is executed on a computer with the followingcharacteristics:
- CPU time for one multiplication is 100 microseconds
- CPU time for one addition is 5 microseconds
- The memory reference time for either read or write is 200microseconds
- Let n=1000, what is the total time required to perform themultiplication. Assume that
OROR