I am studying Computer Science.
Currently we are doing time complexities of loops..
I am confused on how to count the repetitions of the loop..
For ( i=1; i<=n; i++)
For (int j=1; j<=2; j x= 2)
i j reps
1 1-2 2
2 1-2^2 3
3 1-2^2 3
n 1-2^n ?
Do you count the inner loop? Do you add up the previous repetitions?
Im just totally confused.
Any break down would be appreciated. Thanks guys