[algogeeks] Re: for loop performace in terms of speed makes any difference when we run from max to min and min to max

2010-11-24 Thread shiva
After googling i came to know that comparison with 0 takes less time than comparing with some other number.So decremental loop is fast(difference is very very low) On Nov 22, 5:42 pm, rahul patil rahul.deshmukhpa...@gmail.com wrote: Might be its is due to the comparison operation which takes

Re: [algogeeks] Re: for loop performace in terms of speed makes any difference when we run from max to min and min to max

2010-11-24 Thread Rishi Agrawal
I think the compiler today can identify this optimization and thus the final code will be the same. You can check the assembly code generated by the gcc compiler for both the loops. On Wed, Nov 24, 2010 at 4:29 PM, shiva shivanand.kadwad...@gmail.comwrote: After googling i came to know that