Fundamentals of algorithms - AQADecomposition

Algorithms are step-by-step plans for solving problems. They can be designed using pseudo-code and flowcharts.

Part ofComputer ScienceComputational thinking and problem solving

Decomposition

is breaking a problem down into smaller, more manageable chunks. In programming, this means breaking down an into smaller problems that can be solved on their own.

For example, using the times table problem from the previous page, this could be broken down in the following way:

num ← USERINPUT
FOR number ← 1 TO 10 OUTPUT number * num
ENDFOR
Diagram showing how a program outputting the times table up to ten can be decomposed.

In larger programs, problems are decomposed further until it is easy to identify how each could be written as an individual in the program. This is useful to a development team, for example, as it means that the work can be divided between them. As the problem has been broken down into smaller sections, the subroutines can be reused to solve similar problems.