JS数组二分法查找

function binarySerach(arr,val,leftIndex,RightIndex){
	var mid = Math.floor((leftIndex+RightIndex)/2);
	var midVal = arr[mid];
	if(midVal>val){
		binarySerach(arr,val,leftIndex,mid);
		console.log("在左边");
	}else if(midVal

你可能感兴趣的:(JS数组二分法查找)