Time Complexity analysis


#1

Can anyone please explain the time complexity of this problem.


#2

Time complexity is O(2^N), because for each element you have two choices you select or not.


#3

it will be O( 2^N+1) OR SIMPLY O(2^N)
it is 2^N +2^N-1 +2^N-2…+1
which is 2(2^N-1)
i.e 2* 2^N
i.e 2^(N+1)