Plz tell me how I would calculate time complexity of the program:
int i = N;
while (i > 0)
{
int Sum = 0;
int j;
for (j = 0; j < i; j++)
Sum++;
cout << Sum << endl;
i--;
}
thnx in advance
Rose Aashii 0 Newbie Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
brainbox 0 Light Poster
brainbox 0 Light Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
brainbox 0 Light Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
sun_kangane 0 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
nashieRbaba 0 Newbie Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
yol 0 Newbie Poster
lulusweety 0 Newbie Poster
Salem 5,199 Posting Sage
lulusweety 0 Newbie Poster
darkagn 315 Veteran Poster Featured Poster
lulusweety 0 Newbie Poster
jumbo2cool 0 Newbie Poster
sarehu 84 Posting Whiz in Training
haxpor 0 Newbie Poster
ashishforindia 0 Newbie Poster
John_231 commented: The best you can do is to delete this +0
Dutchovens 0 Newbie Poster
aadnan.tufail -3 Newbie Poster
TrustyTony commented: Create your own question thread with proof of effort -3
Ali_84 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.