listing recursion continued arr display()/display array int searchkey /search for item ifarr find(searchkey!arr size(system out println("found searchkey)else system out println("can' find searchkey)/end main(/end class binarysearchapp ///////////////////////////////////////////////////////////////in main(we insert items into the array the insert(method arranges them in sorted orderthey're then displayed finallywe use find(to try to find the item with key value of here' some sample output found in binarysearch java there are items in an array figure shows how the recfind(method in this program calls itself over and overeach time with smaller range than before when the innermost version of the method finds the desired itemwhich has the key value it returns with the index value of the itemwhich is (as can be seen in the display of ordered datathis value is then returned from each version of recfind(in turnfinallyfind(returns it to the class user the recursive binary search has the same big efficiency as the non-recursive versiono(lognit is somewhat more elegantbut may be slightly slower divide-and-conquer algorithms the recursive binary search is an example of the divide-and-conquer approach you divide the big problem into two smaller problems and solve each one separately the solution to each smaller problem is the sameyou divide it into two even smaller problems and solve them the process continues until you get to the base casewhich can be solved easilywith no further division into halves the divide-and-conquer approach is commonly used with recursionalthoughas we saw in the binary search in you can also use non-recursive approach divide-and-conquer approach usually involves method that contains two recursive calls to itselfone for each half of the problem in the binary searchthere are two such callsbut only one of them is actually executed (which one depends on the value of the key the mergesortwhich we'll encounter later in this actually executes both recursive calls (to sort two halves of an array