decompositionBreaking down a complex problem or system into smaller parts that are more manageable and easier to understand. is breaking a problem down into smaller, more manageable chunks. In programming, this means breaking down an algorithmA sequence of logical instructions for carrying out a task. In computing, algorithms are needed to design computer programs. 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
In larger programs, problems are decomposed further until it is easy to identify how each could be written as an individual subroutineA section of code written outside of the main program. The umbrella term for procedures and functions. 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.