Forget about the outer loop. Just remember that on it's way from $N$ to 1, $i$ gets divided by $2$ on each iteration.
Now, on the first iteration of the second loop, $j$ will go from $0$ to $N$, and so we will have $N-0+1 = N+1$ steps. On the second iteration, $j$ will go from $0$ to $\frac N2$, so we will have $\frac N2 + 1$ iterations. You can see how this evolves: $(N + 1) + (\frac N2 + 1) + (\frac N4 + 1) + \dots + 2.$
For simplicity, let's remove the $1$'s from each term because their effect on $N$ is insignificant as $N \rightarrow \infty$.
Now, all you have to do is sum up $S = N + \frac N2 + \frac N4 + \dots + 1$.
Factorizing $N$ gives $S = N(1 + \frac 12 + \frac 14 + \dots +\frac {1}{2^n}) = N \sum_{k=0}^{n} (\frac 12)^k$.
The result of the sum (using the formula of a finite geometric series) is $2(1-(\frac 12)^{N+1})$. As $N\rightarrow \infty$, this sum tends to $2(1-0) = 2$.
Finally, we have that $T(N) = \Theta(2N) = \Theta(N)$.
i
decrement the half each iteration. will start fromN, N/2, N/4, N/8,....,N/N
– 0xh3xa May 13 '20 at 12:55