What is the complexity of matrix addition?

后端 未结 4 1473
清酒与你
清酒与你 2021-02-19 21:02

I have found some mentions in another question of matrix addition being a quadratic operation. But I think it is linear.

If I double the size of a matrix, I need to calc

4条回答
  •  伪装坚强ぢ
    2021-02-19 21:05

    It's O(M*N) for a 2-dimensional matrix with M rows and N columns.

    Or you can say it's O(L) where L is the total number of elements.

提交回复
热议问题