By Letter: Non-alphabet | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
  Email this page to a friend

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) 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;

< Previous Terms Terms Containing binary search Next Terms >
binary data
binary exponential backoff
binary file
binary large object
binary package
binary search
Boolean search
equivalence class partitioning
inverted index
Binary Synchronous Transmission
binary tree
binding handle

Web Standards & Support:

Link to and support Powered by LoadedWeb Web Hosting
Valid XHTML 1.0!Valid CSS! FireFox Extensions