I have an algorithm like the following
for(int k) {
statement1;
for(int j) {
statement2;
}
for(int m) {
statement3;
}
}
j => m
Is it correct for me to conclude that the complexity class is O(n^2)?
I have an algorithm like the following
for(int k) {
statement1;
for(int j) {
statement2;
}
for(int m) {
statement3;
}
}
j => m
Is it correct for me to conclude that the complexity class is O(n^2)?
k
,j
, andm
are. The answer will depend on the answer to that. Anyway, it looks like this is covered by our reference material. – D.W. May 31 '16 at 03:39