top of page

What is Decomposition?

Decomposition in computer science, refers to the process by which a complex problem or system is broken down into parts that are easier to conceive, understand, program, and maintain.Before computers can solve a problem, the problem and the ways in which it can be resolved must be understood.

Why is decomposition important?

If a problem is not decomposed, it is much harder to solve. Dealing with many different stages all at once is much more difficult than breaking a problem down into a number of smaller problems and solving each one, one at a time. Breaking the problem down into smaller parts means that each smaller problem can be examined in more detail.

Decomposition in real life

Imagine you want to organise all your DVDs alphabetically and you have a lot of them! Where would you start?

Chances are you already know the answer. You might decompose the task into the following steps:

1. Take all the DVDs off your shelf.

2. Sort the DVDs into piles based on the first letter of the title.

3. Start with the 'A' pile. Organise this group into alphabetical order by second and third letters.

4. Place them on the shelf.

5. Repeat for the rest of the alphabet.

How do computer programmers use decompostion?

 

Computer programmers do exactly the same thing. When they are writing a program they often break the code into small chunks.

Decomposition saves a lot of time: the code for a complex program could run to many lines of code. If a mistake was made it would take a very long time to find.

Say they were making a game, it would go a like this.

<-------------

bottom of page