Computer Science, asked by eddggh4046, 1 year ago

Which one will be faster?

a.For(int i = 0; i < 1000; i++) {}

b.For(int i = 1000; i > 0; i–) {}?

Answers

Answered by aman3813
0
Hey mate 2nd one is correct.
Answered by digi18
1
Time of execution for both would be the same which O(n). Here n is the no. Of steps it will run.

So here n is same for both which is 1000.


Thanks
Similar questions