Page 1 of 1

Suppose we have a sorted array of n numbers, A[1] ≤ A[2] ≤ ... < A[n]. Write an algorithm that searches the array to see

Posted: Fri Jul 08, 2022 7:26 am
by answerhappygod
Suppose We Have A Sorted Array Of N Numbers A 1 A 2 A N Write An Algorithm That Searches The Array To See 1
Suppose We Have A Sorted Array Of N Numbers A 1 A 2 A N Write An Algorithm That Searches The Array To See 1 (18.35 KiB) Viewed 49 times
Suppose we have a sorted array of n numbers, A[1] ≤ A[2] ≤ ... < A[n]. Write an algorithm that searches the array to see if this array contains a particular number x. If the number is present then report index of the number, otherwise report nil. Note: The algorithm time complexity should not be higher than O(log n)