n is compared with 20, 21 , ........ 2floor(lgn) , 2floor(lgn) + 1
So 0 to floor(lgn) + 1, and the expression always evaluates to false for j = floor(lgn) + 1,
Hence, in both the cases floor(lgn) + 2 comparisons are made
Here is an example to make things clearer:
.We need to consider two cases
1) When n = 2k
Take 8 . (1<=8),(2<=8),(4<=8),(8<=8),(16<=8)
five comparisons are made.
2) When n != 2k
Take 11. (1<=11),(2<=11),(4<=11),(8<=11),(16<=11)
Again five comparisons are made .