Driver Code
public static void main ( String [ ] args ) { System . out . println ( " Contains " ) ; for ( int i = 0 ; i < 10 ; i ++ ) System . out . println ( i + " ▁ " + contains ( 0 , n - 1 , i ) ) ; System . out . println ( " First ▁ occurrence ▁ of ▁ key " ) ; for ( int i = 0 ; i < 10 ; i ++ ) System . out . println ( i + " ▁ " + first ( 0 , n - 1 , i ) ) ; System . out . println ( " Last ▁ occurrence ▁ of ▁ key " ) ; for ( int i = 0 ; i < 10 ; i ++ ) System . out . println ( i + " ▁ " + last ( 0 , n - 1 , i ) ) ; System . out . println ( " Least ▁ integer ▁ greater ▁ than ▁ key " ) ; for ( int i = 0 ; i < 10 ; i ++ ) System . out . println ( i + " ▁ " + leastgreater ( 0 , n - 1 , i ) ) ; System . out . println ( " Greatest ▁ integer ▁ lesser ▁ than ▁ key " ) ; for ( int i = 0 ; i < 10 ; i ++ ) System . out . println ( i + " ▁ " + greatestlesser ( 0 , n - 1 , i ) ) ; } }