If there is single element , return it . Else return minimum of first element and minimum of remaining array .
return ( n == 1 ) ? arr [ i ] : Math . min ( arr [ i ] , getMin ( arr , i + 1 , n - 1 ) ) ; } function getMax ( arr , i , n ) {