HGPA

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

Filename: binary-search.md (Edit)
Modified: 2017-02-25 (2a439f02c6a8a5282b6b2152f312cbf219e25d4c)
Created: 2017-02-25 (2a439f02c6a8a5282b6b2152f312cbf219e25d4c)