(String args[])
| 26 | |
| 27 | // Driver method to test above |
| 28 | public static void main(String args[]) |
| 29 | { |
| 30 | BinarySearch ob = new BinarySearch(); |
| 31 | Scanner kb = new Scanner(System.in); |
| 32 | int n = kb.nextInt(); |
| 33 | int arr[] = new int[n]; |
| 34 | for(int i=0;i<n;i++){ |
| 35 | arr[i]=kb.nextInt(); |
| 36 | } |
| 37 | int length = arr.length; |
| 38 | int target = 10; |
| 39 | int result = ob.binarySearch(arr, 0, length - 1, target); |
| 40 | if (result == -1) |
| 41 | System.out.println("Element not present"); |
| 42 | else |
| 43 | System.out.println("Element found at index " + result); |
| 44 | kb.close(); |
| 45 | } |
| 46 | } |
nothing calls this directly
no test coverage detected