plz tell the complexities.

  • Thread starter Thread starter rajesh kalra
  • Start date Start date
R

rajesh kalra

what is the complexity of the following:

for(i=0 to n*n)
{
cout<<"hello\n";
}


and
for(i = 0 to n)
{
for(j = 0 to i*i )
{
for( k = 0 to j )
{
cout<<"hello\n";
}
}
}
 
rajesh kalra said:
what is the complexity of the following:

This sounds like homework to me. It also appears to be in a language
I'm unfamiliar with - it uses cout, which looks like C++, but that
doesn't use that kind of for loop...
 
Back
Top