Back to A-Level
2.3

Algorithms

Sorting, searching, path-finding, and algorithm analysis

Analysis and design of algorithmsSearching algorithmsSorting algorithmsGraph/tree traversalOptimisation algorithms

Big O notation: O(1) constant, O(n) linear, O(n²) quadratic, O(log n) logarithmic

Linear search: O(n), checks each element sequentially

Binary search: O(log n), requires sorted data, divides search space

Bubble sort: O(n²), swaps adjacent elements, simple but slow

Merge sort: O(n log n), divide and conquer, stable

Quick sort: O(n log n) average, O(n²) worst, in-place

Dijkstra's: Finds shortest path in weighted graph

A*: Uses heuristic for more efficient pathfinding

Exam Tips

  • Always define key terms before explaining concepts
  • Use specific examples where possible to demonstrate understanding
  • Check mark allocation - one point per mark is a good guide