Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "You need the first matching record from a small unsorted array, and this query runs once. What is the best starting strategy?" on CodeWiki (https://codewiki.com/practice/mcq/foundations/sorting-and-searching/choose-one-off-search/).
Context (verbatim from the page):
"""
You need the first matching record from a small unsorted array, and this query runs once. What is the best starting strategy?
Scan in input order and stop at the first match.
Sort the entire array, then run binary search.
Build both a hash index and a balanced tree.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in CS foundations. Where you are unsure, say so.