---
format: 1
concept: "binary-search"
kind: "misconception"
id: "unsorted-is-fine"
title: "Binary search works on any list"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "aipage"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Binary_search"]}
---
It's tempting to think of binary search as "a faster way to search", full stop. But it gets its speed by **throwing away half the list after one look**, and that's only safe when the items are in order. On an unsorted list it can throw away the half that holds the target and wrongly report "not found".

Fix: sort the list first (if you'll search it many times), or check items one by one (if you'll search it once).
