---
format: 1
concept: "binary-search"
kind: "question"
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"]}
---
You want to find 50 in this list with binary search: `8, 3, 50, 21, 14, 42`. What's the problem?

```json
{
  "type": "choose",
  "purpose": "practice",
  "explanation": "Binary search decides which half to keep by comparing with the middle item. That only tells you where the target *can't* be when the list is sorted. Here the middle (position 2, rounding down) holds 50 by luck, but try 42: the middle is 50, 42 is smaller, so you'd search to the left, and 42 is on the right.",
  "options": [
    {
      "text": "The list isn't sorted, so halving can throw away the half that holds 50",
      "correct": true
    },
    {
      "text": "Nothing: binary search works on any list",
      "correct": false,
      "misconception": "unsorted-is-fine"
    },
    {
      "text": "The list has an even number of items, so there is no middle",
      "correct": false
    },
    {
      "text": "50 is too big for binary search",
      "correct": false
    }
  ],
  "multiple": false
}
```
