1
Loading subject content…
Loading subject content…
Loading practice questions…
What is the output of the following code?
import bisect
print(bisect.bisect_left([1, 3, 3, 5], 3), bisect.bisect_right([1, 3, 3, 5], 3))Using binary search (mid = ⌊(low + high)/2⌋) on the sorted array [2, 7, 11, 15, 17, 19, 20, 31], how many comparisons with array elements are needed to find 17?
Using binary search (mid = ⌊(low + high)/2⌋) on the sorted array [2, 7, 8, 11, 14, 23, 27, 31, 35, 39], how many comparisons with array elements are needed to find 31?