int search ( DataType t ) { int l,u,m; l = 0; u = n -1 ; while ( l <= u ) { m = ( l + u ) /2 ; if ( x[m] < t ) { l = m + 1; } else if ( x[m] == t ) { return m; } else { u = m - 1; } } return -1 ; }