SHARE
TWEET

Untitled

a guest Sep 9th, 2017 172 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public int binSucheRekursiv(int[] pArray, int pZahl, int links, int rechts)
  2.     {      
  3.         int mitte = (links + rechts)/2;
  4.        
  5.         if (links > rechts)
  6.             return 0;
  7.            
  8.         else if (pArray[mitte] == pZahl)
  9.             return mitte;
  10.            
  11.         else if (pArray[mitte] > pZahl)  
  12.             return binSucheRekursiv(pArray, pZahl, links, mitte--);
  13.            
  14.         else if (pArray[mitte] < pZahl)  
  15.             return binSucheRekursiv(pArray, pZahl, mitte++, rechts);  
  16.            
  17.         else
  18.             return 0;
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top