|
-
November 7th, 2008, 08:37 AM
#1
Time Complexity
i have a c++ code here. Plz assisst me that if i want to calculate its time complexity considering it as an algorithm. How can i do that? What would be its time complexity?
#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;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|