Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public static int binarySearch(float time, int left, int right){
  2. long tStart, tEnd, msecs;
  3. int q=(left+right)/2;
  4. int[]tmpArr=befuelle(q);
  5. tStart=System.currentTimeMillis();
  6. bubblesort(tmpArr);
  7. tEnd=System.currentTimeMillis();
  8. msecs=tEnd-tStart;
  9. if(msecs<(time*1000)+100&&msecs>(time*1000)-100){
  10. return q;
  11. }else{
  12.  
  13. if(msecs<=time*1000){
  14. return binarySearch(time,left,q);
  15. }else{
  16. return binarySearch(time,q+1,right);
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement