Binary search

What is a binary search and whats the difference between binary and a normal search?

Thanks in advance
A binary search requires that the list of items to be searched are sorted into sequence. After each test, half of the list can be eliminated (or the item found).

The other common type of search is the sequential search, where the items don't have to be sorted. Here, the search simply steps through the items one at a time until a match is found.

For a small list, say 10 items, the sequential search is fine, and the extra complexity of the binary search may not be justified. But for very large lists the binary search is very much faster.
Topic archived. No new replies allowed.