in Algorithms retagged by
228 views
0 votes
0 votes

The complexity of matrix multiplication of two matrices A and B whose orders are $m \times n$ and $n \times p$ respectively is

  1. $\text{O(m} \times p)$
  2. $\text{O(m} \times n^2 \times p)$
  3. $\text{O(m} \times n \times p^2)$
  4. $\text{O(m} \times n \times p)$
in Algorithms retagged by
by
228 views

1 Answer

0 votes
0 votes
Best answer
No of multiplications needed = m*n*p, No of additions = m*(n-1)*p

Total operations = mnp+mnp-mp = mp(n+n-1) = (2n-1)mp $\to$ O(mnp)

$\therefore$ d)
selected by