base condition is , if we are reaching at left corner or right corner of primes [ ] array then return that corner element because before or after that we don 't have any prime number in  primes array
if ( mid == 0 mid == primes . length - 1 ) return primes [ mid ] ;