Optimization by loop re-factoring
Instead of:
for(int i = 0; i < MAX; ++i)
if(i != ID)
{
// DO SOMETHING
}
}
Use:
for(int i = 0: i < ID; ++i)
{
// DO SOMETHING
}
for(int i = ID; i < MAX; i="">
{
// DO SOMETHING
}
for(int i = 0; i < MAX; ++i)
if(i != ID)
{
// DO SOMETHING
}
}
Use:
for(int i = 0: i < ID; ++i)
{
// DO SOMETHING
}
for(int i = ID; i < MAX; i="">
{
// DO SOMETHING
}
8 Comments:
At 8:30 AM, Anonymous said…
Sorry, but what does the ID stand for?
At 11:11 PM, Anonymous said…
Good design!
[url=http://acomvfey.com/aljx/lelc.html]My homepage[/url] | [url=http://gjgjdyyq.com/mbrf/aizw.html]Cool site[/url]
At 11:12 PM, Anonymous said…
Good design!
http://acomvfey.com/aljx/lelc.html | http://bdyxcjcb.com/ndof/ibzo.html
At 10:18 PM, Computer Science said…
Nice Topic
I hope you take a look to my blog
http://ebook44free.blogspot.com/
It is about FREE eBooks
Thanks..,
At 4:33 PM, Anonymous said…
mmmm.yes k.....
At 7:13 AM, Mehmet Karadeniz said…
That looks longer than first one but it's good to know another way.
At 4:28 AM, Talha Habib said…
Can You Tell ME How to make text movement like marquee
I saw a lesson on maquee topic but can't understand it can you please give me code also
At 12:23 PM, Unknown said…
For learning "c programming" visit http://www.cprogramming-bd.com/c_page1.aspx#c%20programming
Post a Comment
<< Home