DataStructures / Data structures Interview questions
Explain binary search.
A binary search works only on sorted lists or arrays. This search starts at the middle element which splits the entire list into two parts. This search first compares the target value to the mid of the list. If it is not found, then it takes decision on whether to search on first part or second part if the search value is lesser than middle element or greater vice versa.
Binary search is also known as half-interval search or logarithmic search.
More Related questions...