Skip to content

Array algorithms: max, count, search, average

Handout

Four classic array jobs

  • Most array work is one of four scans: find the maximum, count matches, search for a value, or take an average.
  • Each one is a single for loop over the array, with a variable that remembers something.
  • Once you know these four, most array problems are a small change to one of them.

Handout

Log in or create account

IGCSE & A-Level