wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

A search begins the search with the element that is located in the middle of array _________________.

A
serial
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
random
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
parallel
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
binary
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D binary

A binary search begins the search with the element that is located in the middle of array.

Binary searchis a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found. If the search ends with the remaining half being empty, the target is not in the array. Even implementing binary search correctly requires attention to some subtleties about its exit conditions and midpoint calculation.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Events
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon