big o - C++ - Big-O Notation -


for reason im unable solve this. big-o notation

for (int = 0; < n; i++)     (int j = 0; j < n; j++) {         c[i][j] = 0;         (int k = 0; k < n; k++)             c[i][j] += a[i][k] * b[k][j];     } 

for (int = 0; < n; i++)  (int j = 0; j < n; j++) {   c[i][j] = 0;   (int k = 0; k < n; k++) c[i][j] += a[i][k] * b[k][j];  } 

it looks it's o(n^3) because has 3-level loops.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -