Topic module

Standard Array Algorithms

Describe, design and implement linear search, minimum or maximum, and count-occurrence algorithms over arrays and arrays of records.

Long-form learning
Concept to Risk to Memory to Check-up

How to study Higher Computing Science

Move from requirements to structured designs, trace code and data precisely, and support every test or evaluation judgement with observable evidence.

Core concepts

Concept 1

Linear search checks elements in sequence until a match is found or the collection is exhausted.

Exam cue: Set initial values before the loop and explain why they are valid.

Concept 2

Minimum and maximum algorithms initialise from valid data and update a current best value while traversing.

Exam cue: State the loop bounds from the actual collection size.

Concept 3

Counting occurrences uses a correctly initialised counter and increments only when the stated condition is true.

Exam cue: For arrays of records, compare the correct field and preserve the associated record if needed.

Risk pitfalls and guardrails

Initialising a maximum to zero when all valid values may be negative.

Guardrail: Check route, scope, data type, boundary, loop condition, identifier and expected output before committing to the response.

Stopping a search without distinguishing found from not found.

Guardrail: Check route, scope, data type, boundary, loop condition, identifier and expected output before committing to the response.

Incrementing the counter on every iteration rather than only on matches.

Guardrail: Check route, scope, data type, boundary, loop condition, identifier and expected output before committing to the response.

Memory anchors

Linear search

Inspect each element in sequence until a match is found or no elements remain.

Found flag

A Boolean can record whether the search located a match.

Maximum initialisation

Initialise the current maximum from the first valid element, not an arbitrary value.

Minimum update

Replace the current minimum only when a smaller value is encountered.

Count occurrences

Initialise count to zero and increment it only when the target condition is met.

Record algorithm

Compare the relevant field but retain the full record or its index when output needs associated data.

Checkpoint rule

Do the check-up only after you can summarize each concept in one sentence and identify one dangerous pitfall from memory.

Knowledge Check (after reading)

Short check-up to confirm understanding of this module.

Check-up Questions

1-2 question checkpoint

A linear search checks [14, 9, 21, 6] from index 0 for target 21. Which index is returned?

What should a linear-search function return when the target is absent and all valid indices are non-negative?

Answer all questions to submit.

Next step personalized recommendations

What is Pass Harbor?

Completely free exam prep for 247 UK exams.

  • Practice questions
  • Flashcards
  • Study guides
  • Mock exams
  • No registration
  • No paywall
  • Start instantly
No more expensive exam prep. Quality study tools should be accessible to everyone.