I was wondering if there is a complexity and time difference when doing these two operations:
1)
int sum = 0;
for (int i = 0; i < 1000000; i++) {
sum = sum + i;
}
2)
int sum = 0;
for (int i = 0; i < 1000000; i++) {
sum += i;
}
or maybe image the problem to be bigger numbers/data, this is just an example.