Solution can be nlogn too


#1

We have N+N/2+N/4+…1
=N(1+1/2+1/4+…1/N) = NlogN


#2

N(1+1/2+1/4+…0) = 2*N not NlogN

(1+1/2+1/4+…0) = 2 sum of GP