For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a number of elements in the array, and the number K is separated by space. The next line contains N elements.

<b>Constraints:</b>
1 &le; T &le; 10
1 &le; N &le; 10<sup>5</sup>
1 &le; K &le; 10<sup>9</sup>
1 &le; arr[i] &le; 10<sup>9</sup>

<b>Sum of N over all test cases doesn't exceed 10<sup>6</sup></b>If the element is present in the array print "1" else print "-1".Sample Input:
2
5 6
1 2 3 4 6
5 2
1 3 4 5 6

Sample Output:
1
-1, I have written this Solution Code: static int isPresent(long arr[], int n, long k)
	{
	    int left = 0;
			int right = n-1;
			int res = -1;
			while(left<=right){
				int mid = (left+right)/2;
				if(arr[mid] == k){
					res = 1;
					break;
				}else if(arr[mid] < k){
					left = mid + 1;
				}else{
					right = mid - 1;
				}
			}
			
			return res;
	}, In this Programming Language: Java, Now tell me if this Code is compilable or not?