Otherwise
else System . out . println ( arr [ K ] ) ; } static void reverse ( int [ ] a ) { int i , k , t ; int n = a . length ; for ( i = 0 ; i < n / 2 ; i ++ ) { t = a [ i ] ; a [ i ] = a [ n - i - 1 ] ; a [ n - i - 1 ] = t ; } } static int count ( int [ ] a , int n ) { int freq = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { if ( a [ i ] == n ) freq ++ ; } return freq ; }