Time complexity of ques1

Isn’t the time complexity of ques1 logN ?

yes for question1 it is logN