For the questions that don’t fit in a textbook. Find their starting point
Fahahu

Ages 16–18 · A Level · Growing

Binary search with duplicate keys

Use the evidence in binary search with duplicate keys to select and justify a valid solution.

Understand the idea

Complexity describes growth with input size rather than one timing result.

Your challenge

A binary search finds one occurrence of key 7 in sorted [2,7,7,7,9]. The API promises the first occurrence. What additional action is needed after a match?

  • Return immediately from any matching midpoint
  • Search only to the right for the first occurrence
  • Continue searching the left candidate range while remembering the match

How to explore

  • Distinguish finding an occurrence from proving it is the earliest.
  • Compare each proposed response with the complete observation or trace, rather than with only one familiar word.
  • Check the selected response against the complete situation, including a case where a tempting alternative fails.

Open the activity to work with its controls and check your reasoning. Progress stays in this browser.

Keep exploring

DON’T LET THE QUESTION END HERE

Give that curiosity
somewhere to go.

Open the learning space

Discovery

Digital models simplify the real world. Explore with a grown-up and talk about what you notice.

Find something worth exploring

Explore free activities and printables, or learn about the separately paid Academy courses.