They let fast lookup, addition and removal of items, and can be used to implement either dynamic sets of items, or lookup tables that let finding an item by its key (e.g., finding the telephone number of a person by name).Binary search trees keep their keys in sorted order, so that lookup and other operations can use the principle of binary search: when looking for a key in a tree (or a place to insert a new key), they traverse the tree from root to leaf, make comparisons to keys stored in the nodes of the tree and deciding, on the basis of the comparison, to continue searching in the left or right subtrees.

COMING SOON!

```
#include <stdio.h>
#include <stdlib.h>
#define len 5
int binarySearch(int array[], int leng, int searchX)
{
int pos = -1, right, left, i = 0;
left = 0;
right = leng - 1;
while(left <= right)
{
pos = left + (right - left) / 2;
if(array[pos] == searchX)
{
return pos;
}
else if(array[pos] > searchX)
{
right = pos - 1;
}
else
{
left = pos + 1;
}
}
return -1; /* not found */
}
void main(int argc, char *argv[])
{
int array[len] = { 5, 8 , 10 , 14 ,16 };
int position;
position = binarySearch(array, len, 5);
if (position < 0)
printf("The number %d doesnt exist in array\n", 5);
else
{
printf("The number %d exist in array at position : %d \n", 5, position);
}
}
```