No O(2n), it's that simple O(n). In other words, it scales at the same speed as n.
If it was a nested loop, that would be , but the presence of your empty blocks means that it is not nested.O(n2){}
, , n, . , O(n).
O(n), O(cn) O(n+c) ( c - ) . , .
, O(7n3 + 3n2 + 12n + 2), O(n3).