Skip to main content
WalesComputer Science

WJEC GCSE Computer Science Algorithms and programming principles: a complete overview of computational thinking, searching, sorting, constructs and logic

A deep-dive WJEC GCSE Computer Science guide to the Algorithms and programming principles content in Unit 1. Covers computational thinking, algorithms in flowcharts and pseudocode, linear and binary search, bubble and merge sort, the three programming constructs, variables and constants, operators, subprograms and a modular approach, and Boolean logic with truth tables and gates.

Generated by Claude Opus 4.814 min read3500 Unit 1 Algorithms and programming principles

Reviewed by: AI editorial process; not yet individually human-reviewed

Jump to a section
  1. What the Algorithms and programming principles content demands
  2. Computational thinking and algorithms
  3. Searching algorithms
  4. Sorting algorithms
  5. Programming constructs
  6. Subprograms and program structure
  7. Logical operations
  8. Check your knowledge

What the Algorithms and programming principles content demands

This area is where WJEC checks that you can think computationally and reason about how programs work, even though the heavy practical programming is assessed in Units 2 and 3. The standard algorithms (linear and binary search, bubble and merge sort) and the three constructs are examined repeatedly, often by tracing or describing them, and the Boolean logic and truth-table questions are reliable marks. The content links to hardware (logic gates build the CPU) and to software development (algorithms are planned before being coded).

This guide walks through the Algorithms and programming principles content and ties together the matching dot-point pages, each of which has its own worked examples and practice questions.

Computational thinking and algorithms

Computational thinking solves problems for a computer. Decomposition breaks a big problem into smaller sub-problems; abstraction removes unnecessary detail. An algorithm is a step-by-step sequence of instructions; it is the plan, while a program is its implementation. Algorithms are commonly expressed as flowcharts (standard symbols: terminal, input/output parallelogram, process rectangle, decision diamond) or as pseudocode (structured, English-like statements).

Searching algorithms

A linear search checks items one by one and works on any list but is slow on large ones. A binary search works only on sorted data: it checks the middle, discards the half that cannot contain the target, and repeats, halving the list each time, so it is much faster on large lists. Choose linear for small or unsorted lists, and binary for large, already-sorted lists.

Sorting algorithms

A bubble sort compares adjacent pairs and swaps those in the wrong order, repeating passes until none swap; it is simple but slow. A merge sort splits the list to single items and merges them back in order (divide and conquer); it is more complex and uses more memory but is far faster on large lists. Choose bubble for small lists or simplicity, and merge for large lists where speed matters.

Programming constructs

The three constructs are sequence (in order), selection (IF, choosing based on a condition) and iteration (loops: FOR for a fixed count, WHILE while a condition holds). A variable's value can change; a constant's is fixed. Operators are arithmetic (+, -, *, /), relational (=, <, >) and logical (AND, OR, NOT), and drive the conditions used in selection and iteration.

Subprograms and program structure

A subprogram is a named, reusable block of code. A procedure does a task without returning a value; a function returns a value. Parameters pass data into a subprogram so it works on different values. A modular, structured approach makes a program easier to manage, reuse, test, debug, read and maintain, and lets a team work on different parts at once.

Logical operations

Boolean logic uses true (1) and false (0). AND outputs 1 only when both inputs are 1; OR outputs 1 when at least one is 1; NOT reverses its single input. A truth table lists every input combination and the output. Each operator has a matching logic gate, and gates combine into circuits that evaluate larger expressions. Simple expressions can sometimes be simplified to use fewer gates.

Check your knowledge

A mix of computational-thinking, algorithm, construct and logic questions covering the Algorithms and programming principles content. Attempt them under timed conditions, then check against the solutions.

  1. State what decomposition means. (1 mark)
  2. Name the flowchart symbol used for a decision. (1 mark)
  3. State one requirement before a binary search can be used. (1 mark)
  4. Describe how a bubble sort orders a list. (2 marks)
  5. Name the three programming constructs. (1 mark)
  6. State the difference between a variable and a constant. (2 marks)
  7. State the difference between a procedure and a function. (1 mark)
  8. State when an AND gate outputs 1, and when an OR gate outputs 1. (2 marks)

Sources & how we know this

  • computer-science
  • wjec-gcse
  • wjec-computer-science
  • algorithms
  • programming
  • gcse