public static int bsearch(int[] arr, int left, int right, int x) { if (right >= left) { int mid = (left right) / 2; if (arr[mid] == x)'