A search algorithm which repeatedly divides an ordered search space in half according to how the required (key) value compares with the middle element. The following pseudo-C routine performs a binary search reTURN the index of the element of vector "thing[first..last]" equal to "target": if (target < thing[first] || target > thing[last]) reTURN NOT_FOUND while (first < last) { mid = (first+last)/2 /* truncate to integer */ if (target == thing[mid]) reTURN mid if (target < thing[mid]) last = mid-1 else first = mid+1 } if (target == thing[last]) reTURN last reTURN NOT_FOUND (2003-01-14)