2018329621261——Homework6 (28.218.81608.81609.81613.9493.84290.83053.84458)

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 though the idea is simple, implementing binary search correctly requires attention to some subtleties about its exit conditions and midpoint calculation, particularly if the values in the array are not all of the whole numbers in the range.

group status

👤 group joined: 0 ⏳ group pending: 0 🚫 group blocked: 0

Sub Domains (0)