Can the upper bound of the loop be reduced to n/2.Since n/2*n/2> n(obviously)


Comment body goes here.


for n>=6, yes it can be done


I don’t understand what you mean, if you are implementing it using binary search (recursion method) than it should not take more than log(n).
plz elaborate what you mean by (n/2*n/2)