public int binarySearch(int[] a,int key)
	{
		int left = 0;
		int right = a.length - 1;
		int middle = 0;
		while(left <= right)
		{
			middle = (left + right)/2;
			if(key == a[middle]) return middle;
			else if(key>a[middle]) left = middle + 1;
			else right = middle - 1;
		}
		return -1;
	}