Computing (FOLDOC) dictionary
Jump to user comments
algorithm A search
algorithm which repeatedly divides an
(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)
if (target == thing[last])
return last;
return NOT_FOUND;
(2003-01-14)