Binary Search

  1. Divide into two halves.
  2. 1st half — max: compare with search value.

1. Whether it equal to the data we are looking for. 2. Search value > 1st half — max 1. Discard the 1st half 2. Continue search in 2nd half 3. Search value < 1st half — max 1. Discard the 2nd half 2. Continue search in 1st half

  1. Continue with step 1.
Updated: 2026 Aug 26