Binary Search
Binary search begins by comparing the searched element with the middle element of the list. If the searched element is less than this element, the search continues in the left half of the list; otherwise, it continues in the right half. This process repeats until the element is found or the list can no longer be divided.
In summary:
- At each step, we compare the searched element with the middle element,
- We reduce the search area by half,
- Then we continue with the rest of the list.
🔎 Cible : 7