Question: if we have a SORTED array of ( mathrm{N} ) numbers: 1. Look at the middle element at the position of ( mathrm{N} / 2
Description In summary, if we have a SORTED array of N numbers: 1. Look at the middle element at the position of N/2 2. If the search element is less than the element at position N/2, then repeat the process using only the left side of the array (1-N/2) 3. If the search element is greater than the element in position N/2, then repeat the process using only the right side of the array 4. If the search element is equal to the element in position N/2, the search is completed END 5. Continue to repeat the process until either the element is found or N/2 = 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
