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

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

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -