Skip to content
Marlbridge

AP® Computer Science A · Unit 4 · Topic 4.14

Searching Algorithms: Checklist (Computer Science A 4.14)

A self-check for linear search: writing the standard pattern, counting comparisons, searching from either end, searching 2D arrays and avoiding the common bugs.

Tick each line when you can do it without looking at the guide. Each line names where it is taught and tested. Revisit the study guide for anything you cannot yet do.

Understanding

  • ☐ I can describe linear search in one sentence and say it works on unsorted data (study guide: Looking for something in a collection; practice: Question 7).
  • ☐ I can explain why -1 is returned after the loop and not inside it (study guide: The standard pattern; Worked example 2; practice: Questions 3 and 8).
  • ☐ I can state the best case, worst case and unsuccessful-search comparison counts (study guide: The standard pattern; practice: Questions 1, 2 and 7).
  • ☐ I can explain why Strings are compared with equals (study guide: Worked example 2; practice: Question 4).

Skills

  • ☐ I can write a linear search for an array returning an index or -1 (study guide: The standard pattern).
  • ☐ I can write a linear search for an ArrayList of Strings (study guide: The standard pattern; practice: Question 9).
  • ☐ I can search from the end to find the last match (study guide: Variations; practice: Question 5).
  • ☐ I can search a 2D array by row or by nested loops (study guide: Variations; practice: Questions 6 and 10).

Reasoning

  • ☐ I can trace a search and say exactly how many comparisons it makes (study guide: Worked example 1; practice: Questions 1 and 2).
  • ☐ I can predict the result of a faulty search such as the early else return (practice: Question 3).
  • ☐ I can say how a search for every match differs from a search for the first match (study guide: Searching for several matches).
  • ☐ I can explain why linear search becomes slow for large collections (study guide: The standard pattern).

Next: Topic 4.15 sorting algorithms.

AP® and Advanced Placement® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website. Marlbridge is an independent tuition provider. It is not an authorized AP course provider, an AP school or an exam centre, and these resources are not official College Board materials. Reading them or doing simulations does not meet the laboratory requirement of an AP science course.