Driver code
static public void main ( String [ ] args ) { Vector < Integer > A = new Vector < Integer > ( ) ; int [ ] arr = { - 2 , 10 , 100 , 250 , 32315 } ; for ( int i = 0 ; i < arr . length ; i ++ ) { A . add ( arr [ i ] ) ; } System . out . println ( bsearch ( A , 10 ) ) ; } }