AlgorithmsTopic Summary

Knowledge Organiser: Subprograms (Functions & Procedures)

Part of Bubble Sort · GCSE GCSE Computer Science revision

This topic summary covers Knowledge Organiser: Subprograms (Functions & Procedures) within Bubble Sort for GCSE Computer Science. Revise Bubble Sort in Algorithms for GCSE Computer Science with 15 exam-style questions and 10 flashcards. This topic appears less often, but it can still be a useful differentiator on mixed-topic papers. It is section 9 of 9 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.

Topic position

Section 9 of 9

Practice

15 questions

Recall

10 flashcards

Knowledge Organiser: Subprograms (Functions & Procedures)

Key Terms
  • Subprogram: A named block of code that can be called multiple times
  • Function: A subprogram that performs a task AND returns a value
  • Procedure: A subprogram that performs a task but does NOT return a value
  • Parameter: A variable in the subprogram definition that receives an input value
  • Argument: The actual value passed to a subprogram when calling it
  • Return value: The output sent back from a function using the return keyword
Must-Know Facts
  • Functions ALWAYS return a value; procedures NEVER return a value
  • Subprograms improve reusability — write once, call many times
  • Each subprogram can be tested independently
  • Subprograms make code easier to read and maintain
  • Bugs fixed inside a subprogram are fixed everywhere it is used
Key Concepts
  • Declare a function: function name(param) ... return value ... endfunction
  • Declare a procedure: procedure name(param) ... endprocedure
  • Call a function: result = calculateArea(5, 3)
  • Parameters are placeholders; arguments are the real values passed in
  • Functions can be used in expressions; procedures cannot
Common Mistakes
  • Confusing functions and procedures: A function RETURNS a value; a procedure does NOT — this distinction is frequently tested and often answered incorrectly
  • Confusing parameters and arguments: Parameters are the placeholders in the function definition; arguments are the actual values passed when calling the function
  • Saying subprograms run faster: Subprograms do not make code faster — they improve readability, reusability, and maintainability, not execution speed
  • Forgetting to use the return value from a function: A function's return value must be stored or used — calling a function without capturing its return is wasted output
  • Not indenting subprogram bodies in pseudocode: The body of a function or procedure must be indented — examiners expect correct pseudocode structure

Revise this topic interactively on PrepWise — self-test mode, tap-to-reveal definitions, and Common Mistakes from examiners.

Try the interactive Knowledge Organiser — free →

Keep building this topic

Read this section alongside the surrounding pages in Bubble Sort. That gives you the full topic sequence instead of a single isolated revision point.

Practice Questions for Bubble Sort

Which of the following best describes bubble sort?

  • A. It selects the smallest element and moves it to the front each pass
  • B. It compares adjacent elements and swaps them if they are in the wrong order
  • C. It divides the list in half repeatedly until each half is sorted
  • D. It inserts each element into its correct position one at a time
1 markfoundation

Describe how bubble sort works. You should refer to what happens during each pass through the list. [3 marks]

3 marksstandard

Quick Recall Flashcards

How does bubble sort work?
Compare adjacent pairs, swap if wrong order, repeat passes
Why is it called bubble sort?
Largest values bubble up to the end like bubbles rising in water

15 questions on Bubble Sort — practise free

Instant marking, adaptive difficulty, and 10 spaced repetition flashcards. Free until your GCSEs.

Try PrepWise Free