Deep Dive: Binary Search Steps

Test yourself on Linear Search with exam style questions, marked instantly.

Flashcards that come back just before you would forget them.

A revision plan that remembers what you know and shows what to do next.

See which topics you have nailed and which need another look.

Quiz yourself on Linear SearchGet your flashcardsBuild my revision planTrack my progress

Deep Dive: Binary Search Steps

To find 23 in [3, 7, 12, 23, 34, 45, 67]:

  1. Find middle: 23 (index 3)
  2. Compare: 23 == 23 ✓
  3. Found! Return index 3

To find 45:

  1. Middle: 23. Is 45 > 23? Yes. Look right half: [34, 45, 67]
  2. Middle: 45. Is 45 == 45? Yes!
  3. Found in 2 comparisons

Remember: the list is halved every step, so binary search needs far fewer checks than linear search on a large list.

Make this stick

Signing in gives access to all PrepWise features.

PrepWise is a trading name of A3M Quality Solutions Limited, registered in England and Wales, company number 14959172. Registered office: 202 Stroud Road, Gloucester, GL1 5LA. ICO registration ZC267069.