suppose
1 3 4 4 4 4 4 6 7 9
4 occurs in middle but not majority by n/2
it is present both in middle as well as the neighbourhood.
The algo checks to find the position of frst occurance of 4.
here for 4 it is,3
>n/2 times means
there should be span of n/2 4 s,since element are in sorted order,nothing between span of 4 s.
Hence,i+n/2 th index must also be 4 .here it is not ,so here 4 is not occurring > n/2
core of the algo is a BS which is logn