Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (9 sloc) 303 Bytes

Binary Search

Concept

Assuming you have a SORTED list:

  1. look at middle item in list:
  • if item is what you're searching then you're done!
  • if item < search then repeat (1) with first half of list
  • if item > search then repeat (1) with second half of list

It's that simple