Download to read offline


![Algorithm of Binary search
It can be done by the following step:
1. get the middle element
MID= INT((BEG+END)/2)
2. if the middle element equals to the searched value, the algorithm stops.
3.Otherwise
a)If Item<DATA[MID],then appear left half
DATA[BEG]…….DATA[MID-1]
b)If item>DATA[MID],then appear right half
DATA[BEG]…….DATA[MID+1]](https://image.slidesharecdn.com/binarysearch-200312062402/75/Binary-search-in-data-structure-3-2048.jpg)


Binary search is a fast search algorithm that works on sorted data by comparing the middle element of the collection to the target value. It divides the search space in half at each step to quickly locate an element. The algorithm gets the middle element, compares it to the target, and either searches the left or right half recursively depending on if the target is less than or greater than the middle element. An example demonstrates finding the value 23 in a sorted array using this divide and conquer approach.
The presentation defines binary search, a fast search algorithm using divide and conquer, which requires sorted data. An example illustrates its application on a sorted array of ten elements.