Consider the following algorithm to compute the product of two matrices.
def matrix_product(A, B):
mA = number of rows in A
mB = number of rows in B
nA = number of columns in A
nB = number of columns in B
if nA not equal mB:
print("Matrix dimensions are not compatible for multiplication.")
return NULL
matrix_product = an mA x nB array
for row in [0, 1, ..., mA - 1]:
for col in [0, 1, ..., nB - 1]:
myEntry = 0
for index in [0, 1, ..., nA - 1]:
myEntry = myEntry + (A[row, index] * B[index, col])
matrix_product[row, col] = myEntry
return matrix_product
Let `mA` denote the number of rows in matrix `A`, `nA` denote the number of columns in `A`, `mB` denote the number of rows in `B`, and `nB` denote the number of columns in `B`. Which expression best defines the run-time complexity of the matrix multiplication alrorithm, using big-O notation?