I understand the first statement depends on how many n there is, as it will loop until n so O(n).
I understand the second one is just 1 process regardless of n so its O(1).
The third i am still not understanding but i assume since one loop is dependent on n, nested in another n that it will be o(n²)
However, i dont understand how to get for example 2n+1 for the calculations for the first one. I dont understand how the second one is 2. How do i calculate this? Thank you.