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)