0
/ 2.5
Complete the following binary search method. Find the number num
in the array array
. Return -1 if the number is not found. You may assume...
Complete the following binary search method. Find the number num
in the array array
. Return -1 if the number is not found. You may
assume the array is properly ordered.
Examples:
binarySearch({1,4,7},7) -> 2
binarySearch({2,6,6,8,80},6) -> 2
Your feedback will appear here when you check your answer.