Regarding option 3


#1

why the time complexity of 3 option is O(logn)


#2

Assume if the loop runs for k times for a given value of n, then 2^k <= n , so k<=log_2 ( n).
So for worst time O(log_2 (n) ).