Here lets take eg :
LET n = 10
initially: i = 10 (first loop)
j = 0 < 10(i) so it will loop from 0 to 9 times
NOW AFTER NESTED LOOP GETS OVER THIS TAKES PLACE
i /= 2
SO value of i = 5 (first loop ) 2 iteration.
this time j will run from j = 0 < 5(i) so it will loop from 0 to 5 times
each time value of i will be divided by 2 and similarly for corresponding value of j will iterate from 0 to i/2 times.
so, T(n) = O(n + n/2 + n/4 + … 1) = O(n) for j (This is for iteration of j only )
i j
10 0-9 times
5 0 - 4 times
2 0 - 1 times
similarly value of j which was initially n i.e 10 gets decreased in order on n/2 forming GP & thus we get O(n)