So I'm not really understanding a few things here, when counting the steps in for(int i = 1; i <= n; i++) the answer is:
1 for assignment int i = 1, n+1 for i <= n and n for i++ which comes out to a total of 2n+2. My confusions is in 3 parts:
1.) Isn't the assignment int i = 1; also n? If lets say, n = 5, won't we end up assigning int i = 2, int i = 3... etc?
2.) For i <= n, is it n+1 because you are performing n checks and + 1 when it's false?
3.) Last, is i++ n because you are performing n additions?