var arr = [-34, 1, 3, 4, 5, 8, 34, 45, 65, 87]; //递归方式 function binarySearch(data,dest,start,end ){ var end=end || data.length-1; var start=start || 0; m=Math.floor((end+start)/2); if(data[m]==dest){ return m; } if(dest<data[m]){ return binarySearch(…