Binary Search using Recursion in Java

In this tutorial, I am going to discuss the implementation of a Binary search using recursion in java.

Given an array of sorted integers and a number k. We have to write a code to search  an element k in an array.

For example:

Input: {2, 3, 4, 5, 7, 8},     k = 5

Output: 3 (5 is found at 3rd index)

Input array is sorted and we have to find 5 in this array. The element is found at index 3.