@@ -0,0 +1,947 @@
+import java.util.*;%0Aimport java.lang.*;%0Aimport java.io.*;%0A%0Aclass Ideone%0A%7B%0A%09static int calls = 0;%0A%09public static void main (String%5B%5D args) throws java.lang.Exception%0A%09%7B%0A%09%09int%5B%5D a = %7B2,3,4,5,7,8%7D;%0A%09%09Ideone i = new Ideone();%0A%09%09System.out.println(%22Missing element from the array:%22+i.findMissing(a,0,a.length-1)+%22 Number of times looped:%22+calls);%0A%09%7D%0A%09%0A%09Integer findMissing(int%5B%5D a, int start, int end)%7B%0A%09%09calls++;%0A%09%09if(end-start%3C=1)%7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09%0A%09%09int trnctdAvg = (a%5Bend%5D+a%5Bstart%5D)/2;%0A%09%09int diffIndx = trnctdAvg - a%5Bstart%5D;%0A%09%09if(a%5Bstart+diffIndx%5D!=trnctdAvg)    //check if the number exists at the corresponding index else that is missing%0A%09%09%09return trnctdAvg;%0A%09%09else%7B                               //check both sides of the array%0A%09%09%09Integer leftRetVal = findMissing(a,start, start+diffIndx);%0A%09%09%09Integer rightRetVal = findMissing(a, start+diffIndx, end); %0A%09%09%09return (leftRetVal==null)?rightRetVal:leftRetVal; //return non null value%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create findMissingNumber.java