Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int binarySearch(float time, int left, int right){
- long tStart, tEnd, msecs;
- int q=(left+right)/2;
- int[]tmpArr=befuelle(q);
- tStart=System.currentTimeMillis();
- bubblesort(tmpArr);
- tEnd=System.currentTimeMillis();
- msecs=tEnd-tStart;
- if(msecs<(time*1000)+100&&msecs>(time*1000)-100){
- return q;
- }else{
- if(msecs<=time*1000){
- return binarySearch(time,left,q);
- }else{
- return binarySearch(time,q+1,right);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement