For each of the following sequences of code, use O() notation to describe the
running time in terms of N. Give a lower bound for the running time; don't
just answer that all are O(2^n).
1. double grid[N][N];
...
for (int j = 0; j < N; j++) {
for (int k = 1; k <=3; k++) {
grid[j][k] = j*k;
}
}
2. double m[N][N];
for (int r = 0; r < N; r++) {
for (int c = 0; c <=r; c++) {
m[r][c] = 1;
}
}
for (int d = 0; d < N; d++) {
m[d][d] = 0;
}
Click here for the answers