What is the complexity of matrix addition?

后端 未结 4 1474
清酒与你
清酒与你 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:09

    think of the general case implementation:

    for 1 : n
     for 1 : m
       c[i][j] = a[i][j] + b[i][j]
    

    if we take the simple square matrix, that is n x n additions

提交回复
热议问题