int binarySearch(arr, low, high, key) {
if (high >= low) {
int mid = low + (high - low) / 2;
if (arr[mid] == key) return mid;
else if (arr[mid] > key) return binarySearch(arr, low, mid - 1, key);
else return binarySearch(arr, mid + 1, high, key);
}
return -1;
}