Driver Code
static void Main ( ) { Console . WriteLine ( " Contains " ) ; for ( int i = 0 ; i < 10 ; i ++ ) Console . WriteLine ( i + " ▁ " + contains ( 0 , n - 1 , i ) ) ; Console . WriteLine ( " First ▁ occurrence ▁ of ▁ key " ) ; for ( int i = 0 ; i < 10 ; i ++ ) Console . WriteLine ( i + " ▁ " + first ( 0 , n - 1 , i ) ) ; Console . WriteLine ( " Last ▁ occurrence ▁ of ▁ key " ) ; for ( int i = 0 ; i < 10 ; i ++ ) Console . WriteLine ( i + " ▁ " + last ( 0 , n - 1 , i ) ) ; Console . WriteLine ( " Least ▁ integer ▁ greater ▁ than ▁ key " ) ; for ( int i = 0 ; i < 10 ; i ++ ) Console . WriteLine ( i + " ▁ " + leastgreater ( 0 , n - 1 , i ) ) ; Console . WriteLine ( " Greatest ▁ integer ▁ lesser ▁ than ▁ key " ) ; for ( int i = 0 ; i < 10 ; i ++ ) Console . WriteLine ( i + " ▁ " + greatestlesser ( 0 , n - 1 , i ) ) ; } }