1int y;
2int Search( int left, int right )
3{
4 if( left > right )
5 return -1;
6 else
7 {
8 int mid = ( left + right ) / 2;
9 if( a[ mid ] == y )
10 return mid;
11 else if( a[ mid ] > y )
12 return Search( left, mid - 1 );
13 else
14 return Search( mid + 1, right );
15 }
16}
2int Search( int left, int right )
3{
4 if( left > right )
5 return -1;
6 else
7 {
8 int mid = ( left + right ) / 2;
9 if( a[ mid ] == y )
10 return mid;
11 else if( a[ mid ] > y )
12 return Search( left, mid - 1 );
13 else
14 return Search( mid + 1, right );
15 }
16}