Signed up recently but had issues with the confirmation email?

Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.

Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.

Revision notesQuestionsFor schools
Revise Computing
Log inStart revising free
Revision notesQuestionsFor schoolsLog in

© 2026 Revise Computing · revisecomputing.co.uk

Worried about something?Question Bank UpdatesPrivacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).

Knowledge/A Level/H446/02 Algorithms and programming/Thinking ahead/Determine the preconditions for devising…

Determine the preconditions for devising a solution to a problem

Determine the preconditions for devising a solution to a problem.

2.1.2 Thinking ahead

Practise exam questions

Thinking ahead — Note 2 of 4

For a description of a program, candidates need to be able to determine what additional conditions they need to know before they can produce a solution, and how this information may affect the solution.

What you need to know

Preconditions are requirements that must be true before an algorithm or subroutine is run. Identifying them in advance avoids errors and makes code simpler and easier to reuse.

What to know

  • Example: binary search requires the list to be sorted; a function that calculates an average requires a non-empty list; searching a binary search tree requires every node's left subtree to hold lower values and its right subtree higher ones (a node may have 0, 1 or 2 children).
  • Preconditions can be checked inside the subroutine, or documented so that the calling code is responsible for meeting them.
  • Stating preconditions clearly makes subroutines easier to reuse, because other programmers know what the subroutine expects.
  • Thinking ahead also means identifying what extra information is needed before a solution can be produced, and how it will affect the solution.

Key terms

Precondition

A condition that must be true before a subroutine or algorithm is run for it to work correctly.

Exam technique

  • Tip:For a given scenario, state the precondition AND explain what would go wrong if it was not met. Say what the condition applies to: 'the list must be sorted, e.g. into ascending order', not just 'sorted'.

Ready to test yourself?

Practise 2.1.2 questions
← Previous noteIdentify the inputs and outputs for a given situation2.1.2 Thinking aheadNext note →The nature, benefits and drawbacks of caching2.1.2 Thinking ahead

Back to Thinking ahead

Thinking ahead

Note 2 of 4

  1. 1Identify the inputs and outputs for a given situation
  2. 2Determine the preconditions for devising a solution to a problem
  3. 3The nature, benefits and drawbacks of caching
  4. 4The need for reusable program components
Topic overview