# binary search

Also found in: Dictionary, Thesaurus, Medical.

## binary search

[′bīn·ə·rē ′sərch] (computer science)

A dichotomizing search in which the set of items to be searched is divided at each step into two equal, or nearly equal, parts. Also known as binary chop.

McGraw-Hill Dictionary of Scientific & Technical Terms, 6E, Copyright © 2003 by The McGraw-Hill Companies, Inc.

## binary search

(algorithm)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)

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 =**if (target == thing[last]) return last; return NOT_FOUND;This article is provided by FOLDOC - Free Online Dictionary of Computing (

**foldoc.org**)## binary search

A technique for quickly locating an item in a sequential list. The desired key is compared to the data in the middle of a sequential index or in the middle of a sequential file. The half that contains the data is then compared in the middle, and so on, either until the key is located or a small enough group is isolated to be sequentially searched. See binary.Copyright © 1981-2019 by

**The Computer Language Company Inc**. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.Want to thank TFD for its existence? Tell a friend about us, add a link to this page, or visit the webmaster's page for free fun content.

Link to this page: