AK
Size: a a a
AK
А
YI
undefined
:function binarySearch(arr, num, low = 0, high = arr.length) {
let midle = (low + high) % 2 == 0 ? + (low + high) / 2 : (low + high - 1) / 2;
if (num == arr[midle]) {
return midle;
} else if (num > arr[midle]) {
console.log(midle, "More")
binarySearch(arr, num, midle, high)
} else if (num < arr[midle]) {
console.log(midle, "Less")
binarySearch(arr, num, low, midle)
}
}
let array = [2, 8, 12, 20, 30, 50, 100, 200, 400, 600]
console.log(binarySearch(array, 100))
YI
YI
YI
AM
N
YI
YI
YI
И
МЁ
МЁ
RM
МЁ
МЁ
И
И
МЁ