Driver code
public static void main ( String [ ] args ) { int arr [ ] = { 2 , 3 , 4 , 10 , 40 } ; int n = arr . length ; int x = 10 ; int result = randomizedBinarySearch ( arr , 0 , n - 1 , x ) ; if ( result == - 1 ) System . out . printf ( " Element ▁ is ▁ not ▁ present ▁ in ▁ array " ) ; else System . out . printf ( " Element ▁ is ▁ present ▁ at ▁ index ▁ % d " , result ) ; } }