which is the fastest loop?  |
|
for,while,do while
|
 loops |
|
| |
|
|
|
|
|
|
|
|
1. zal3x89 (262) | 3 years ago | I think it is for.But im not sure. You should do some benchmarks to be sure. Peace..
| |
| |
|
|
gagana (661) | 3 years ago | ok may be it is thanx for the response
| |
|
|
|
DC Area Attractions Find museums, national monuments, historic homes, wineries and more. www.fxva.com | add comment |
|
|
|
2. anu_jak (1989) | 3 years ago | it is for...coz u giv all teh details here as a parmeters
| |
| |
|
|
|
life insurance washington dc? Term/Whole/Universal/Variable… Free Life Insurance Quotes. Life.Insurance202.com | add comment |
|
|
|
3. anu_jak (1989) | 3 years ago | it is for...coz u giv all teh details here as a parmeters
| |
| |
|
|
|
Back in Action Spinecare & Rehab Chiropractic - Spinal Decompression - Rehabilitation - Nutrition. www.virginiachiro.com | add comment |
|
|
|
4. raveemenon (727) | 3 years ago | without doubt it is 'For'. then it depends upoon the circumstance i hope.let linguists comment!
| |
| |
|
|
|
Washington Dodge Dealer Learn About New Deals at Your Local Washington Dodge Dealer www.DodgeDealer.com/DodgeDifference | add comment |
|
|
|
5. winter_man (385) | 3 years ago | Oh this is the programming or computer language issue..I hate my programming subject so much. I took C++ Programming and I got D- for that subject! I hate it so much!
| |
| |
|
|
|
Hotel in Fairfax, VA Official Site- Hyatt Fair Lakes. Across from Fair Oaks Mall. Convenient access to Dulles Airport and Washington DC. Book Online for Hyatt.com's Rate Guarantee. fairlakes.hyatt.com | add comment |
|
|
|
6. stonehr (635) | 3 years ago | Very interesting question you have. I can't say that for loop will be faster than while.Anyhow You can't always use for loop. In many cases you must use while loop.If You use while than You'll have following: x++; while x>=100{... exit;}, so same elements You have in for loop also. for (x=0; x>=100; x++; ){....} You always have a counter and some condition that is checked everytime after is variable changed. So it would be great to avoid use of loop whenever you can.
| |
| |
|
|
|
Moving Company, Washington Fast, and simple on-line storage space locator. Free move-in truck. www.MiniuStorage.com | add comment |
|
|
|
|
stonehr (635) | 3 years ago | Yes You are right dholey, as I said the best is to try to avoid loops if it possible, and of course 'for' loop will have the smallest consumption of memory. You are rated.:)
| |
|
|
dholey (954) | 3 years ago | thanks dude
| |
|
|
|
Free Memory Loops Play Memory Loops, a Fun & Challenging Game at GameHouse. www.GameHouse.com | add comment |
|
|
|
| 8. coolvin (15) | 3 years ago | I dont understand what u mean by fastest loop. Does mean the block of code in the loop,or the efficiency of the for,while statements.
anyway, Do-while if the loop executes only once, because a comparison comes only at the end of the loop once in do-while when translated to machine code.
for means (usually) initialization also included with the loop.so slower.
But,speed of execution depends on a specific implementation.it varies with number of loops or how/when you initialize and increment counters ...
| |
| |
|
|
|
Washington DC Real Estate Appraiser Flanagan Associates Residential Appraisers. Fast Quality Service you can count on. www.flanaganappraisals.com | add comment |
|
|
|
9. AshvinPatel (101) | 3 years ago | its depands on ur code under loop.
| |
| |
|
|
|
D.C. Chrysler Dealer See the New 2009 Vehicles at Your Local Washington Chrysler Dealer www.ChryslerDealer.com | add comment |
|
|
|
10. paki143 (634) | 3 years ago | it is for loop,i am not sure but i think its for loop
| |
| |
|
|
dholey (954) | 3 years ago | THERE IS NO DIFFERENCE ALL THREE POINTS (INITIALIZATION, CONDITION AND INCREMENTATION) are handled in different time so even in for loop it is same the control initializes the variable then checks the condition then runs the body then increments or decrements the value that is same as while, the only advantage is.... in for we can see all thee points in one single line where in other loops they are in different line ... so there is no difference in speed of different loops
| |
|
|
|
Washington Post job with competitive salary Full- and part-time jobs near you. Apply for your dream job today! www.JobsRadar.com | add comment |
|
|
|
| | Washington Dodge Dealer Learn About New Deals at Your Local Washington Dodge Dealer www.DodgeDealer.com/DodgeDifference
| Hotel in Fairfax, VA Official Site- Hyatt Fair Lakes. Across from Fair Oaks Mall. Convenient access to Dulles Airport and Washington DC. Book Online for Hyatt.com's Rate Guarantee. fairlakes.hyatt.com
| Moving Company, Washington Fast, and simple on-line storage space locator. Free move-in truck. www.MiniuStorage.com
|
|
|
|
|