Skip to main content
EnglandComputer Science

AQA A-Level Computer Science 4.3 Fundamentals of algorithms: traversal, searching, sorting, Dijkstra and Big-O

A deep-dive AQA A-Level Computer Science guide to 4.3 Fundamentals of algorithms. Covers graph and tree traversal, linear and binary search, bubble and merge sort, Dijkstra's shortest path, and Big-O time and space complexity with the common orders of growth.

Generated by Claude Opus 4.818 min read4.3

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

Jump to a section
  1. What 4.3 actually demands
  2. Traversal
  3. Searching and sorting
  4. Dijkstra's shortest path
  5. Big-O complexity
  6. Check your knowledge

What 4.3 actually demands

Algorithms turn data structures into solutions. AQA expects you to trace each standard algorithm by hand, state its time complexity in Big-O, and compare algorithms to justify a choice. This module pairs directly with 4.2: traversal works on graphs and trees, search and sort on lists, and Dijkstra on weighted graphs.

Traversal

Depth-first traversal explores as far as possible down a branch before backtracking and uses a stack (or recursion); breadth-first traversal explores level by level and uses a queue. For binary trees, pre-order visits the node first, in-order visits it in the middle (giving sorted order in a BST), and post-order visits it last.

Searching and sorting

Linear search checks each item, O(n)O(n), on any list; binary search halves a sorted list each step, O(logn)O(\log n). Bubble sort swaps adjacent items, O(n2)O(n^2), simple and in place; merge sort splits and merges by divide and conquer, O(nlogn)O(n \log n), faster but using extra memory.

Dijkstra's shortest path

Dijkstra's algorithm finds the lowest-cost path from a start vertex through a weighted graph with non-negative weights, using a priority queue to pick the nearest unvisited vertex, relaxing neighbours and finalising vertices one at a time. It powers satnav and network routing.

Big-O complexity

Big-O expresses how time or memory grows with input size, keeping the dominant term. Learn the order from O(1)O(1) to O(2n)O(2^n), how to read complexity from loop structure (one loop O(n)O(n), nested loops O(n2)O(n^2)), and the difference between tractable and intractable problems.

Check your knowledge

  1. State which data structure depth-first traversal uses and which breadth-first uses. (2 marks)
  2. State the order of nodes for an in-order traversal of a binary tree. (1 mark)
  3. State the requirement binary search has that linear search does not. (1 mark)
  4. Give the worst-case complexity of linear search and binary search. (2 marks)
  5. State the time complexity of bubble sort and merge sort. (2 marks)
  6. Give one advantage of bubble sort over merge sort. (1 mark)
  7. State what Dijkstra's algorithm finds and why it uses a priority queue. (2 marks)
  8. Put O(n2)O(n^2), O(logn)O(\log n) and O(n)O(n) in order from most to least efficient. (1 mark)

Sources & how we know this

  • computer-science
  • a-level-aqa
  • aqa-computer-science
  • fundamentals-of-algorithms
  • a-level
  • searching
  • sorting
  • dijkstra
  • big-o