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

2010-11-22 Thread rahul patil
Might be its is due to the comparison operation which takes many cycles i max takes more cycles of cpu than just simply checking i On Sun, Nov 21, 2010 at 6:50 PM, shiva shivanand.kadwad...@gmail.comwrote: I want to know is there any difference between following two loop in terms of speed.

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

2010-11-21 Thread shiva
I want to know is there any difference between following two loop in terms of speed. 1. for(i=0;imax;i++) { //Some operation } 2. for(i=max; i; i--) { /Some operation } I heard second one is faster but don't have any proof Please comment. -- You received this message because you are