(939 Views)

Binary Search is the most famous and simplest Searching Algorithm that searches the given list for a target element. But the only condition is that the given list should be sorted, only then you can use Binary Search for searching.

Binary search compares the search element to the middle element of the list. If the search element is greater than the middle element, then the left half or elements before the middle elements of the list is eliminated from the search space, and the search continues in the remaining right half. Else if the search element is less than the middle value, the right half or all elements after the middle element is eliminated from the search space, and the search continues in the left half. This process is repeated until the middle element is equal to the search element, or if the algorithm finds that the searched element is not in the given list at all.

7 UpvotesUpvote |
1 DownvotesDownvote |

- Bubble Sort Algorithm in C [55 Views]
- How to Install VirtualBox Guest Additions on Debian 9 Virtual Machine (VM) [108 Views]
- Simple Bubble Sort Algorithm in Java [116 Views]
- What can be done with Augmented Reality [345 Views]
- #undef directive in C Language [139 Views]

- Knuth-Morris-Pratt (KMP) Substring Search Algorithm with Java Example [6566 Views]
- Pseudocode and Algorithm to find whether number is Armstrong Number or Not [5375 Views]
- How To Win Ludo King Game Every Time [5135 Views]
- error: Multiple commands produce error in Xcode 10 [4104 Views]
- Create Dynamic Pagination using Java Spring Boot, Hibernate and MySQL [3317 Views]