Don't know about a binary tree, but a binary search will reduce the number of searches to log2 n, i.e. if you have an array of 256 numbers it will do 8 searches. Basic implementation would be:

`// For an array of 100 numbers, call with binsearch(n, 0, 99);`

int binsearch(int n, int a, int b)

{

if(a == b)

return a;

int mid = a + (b-a)/2;

if(n < array[mid])

return binsearch(n, a, mid);

else

return binsearch(n, mid+1, b);

}

EDIT: this binary search assumes the array is sorted in ascending order.