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
Post a Comment