Algorithms

Computational thinking and algorithm design are two critical skills that A level students will develop during their studies. They will form a firm foundation for developing programs but also have wider benefits in the ability to solve problems in a logical and efficient manner.

Computational thinking

This is a cornerstone of Computer Science. Students need to learn how to use decomposition to break down large problems into smaller, more manageable tasks. They need to use pattern recognition to be able to identify parts of a solution that are repeated and abstraction to manage the complexity of the solution. Students should be able to solve problems in a structured, logical way through the application of computational thinking skills. They should be able to use techniques such as divide and conquer, backtracking, pipelining and heuristics.

Developing algorithms

Algorithms can be expressed as a flow diagram or pseudo-code. Students need to practise and become competent at both of these techniques. Examination boards often issue guidance on the expected format of pseudo-code but at its simplest level, it is a text-based sequence of instructions written in a language independent, structured way so that the required control structures are clear.

Algorithms for manipulating data structures

Students will need to know how to use algorithms to manipulate and maintain data in stacks, queues, linked lists and trees including binary trees. They need to be able to represent the algorithms as flowcharts and pseudo-code. Data structures are used for specific purposes for example, a stack is used to hold register values during an interrupt, a syntax tree is constructed during compilation and a queue is used to hold processes waiting to be executed by the CPU for example. Students should be able to apply their knowledge of data structures within the context of algorithms.

Searching and sorting algorithms

Knowledge of linear and binary searching algorithms are common to all A level specifications. Additionally, students should learn searching algorithms for trees including depth first and breadth first searching.

Students should learn a variety of sorting methods namely bubble, insertion, quick and merge sorts. They should recognise where recursion is used in an algorithm.

Comparing performance of algorithms

When choosing an algorithm, there are several considerations such as ease of coding, how quickly it will complete and how much memory is required. The efficiency of algorithms can be compared by analysing time and space complexity using Big O notation.

Path finding algorithms

Students should understand directed and undirected graph data structures. They should know how to traverse graphs by using a shortest path algorithm and heuristics. Dijkestra’s algorithm is the best known and is forms the computational basis of the Open Shortest Path First (OSPF) routing protocol. The A* algorithm has applications in computer games and data mining.