Considering the given code as an algorithm calculate the time complexity of this code.
#include<iostream>
#include<stdlib.h>
using namespace std;
int main(){
int i, j, n;
for(i=0;i<n; i++){
for(j=0; j<n; j++){
cout<<"my time complexity is = "<<i*j<<endl;
}
cout<<"complexity is increasing"<<j<<endl;
}
system("pause");
return 0;
}
Code tags please [code=cplusplus][/code]. Also if our asking what the time complexity is. Why don't you consider showing us what you understand before we just tell you.
Also it should be cstdlib, since this is cplusplus
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.