Question: Flowchar for the given data? In summary, if we have a SORTED array of N numbers: Look at the middle element at the position of
Flowchar for the given data?
In summary, if we have a SORTED array of N numbers:
- Look at the middle element at the position of N/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)
- 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
- If the search element is equal to the element in position N/2, the search is completed END
- 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
