top of page

What is an Algorithm?

 

You use code to tell a computer what to do. Before you write code you need an algorithm.An algorithm is a list of rules to follow in order to solve a problem.Algorithms need to have their steps in the right order. Think about an algorithm for getting dressed in the morning. What if you put on your coat before your jumper? Your jumper would be on top of your coat and that would be silly! When you write an algorithm the order of the instructions is very important.

Clear instructions

 

When you write an algorithm you need to include precise, step-by-step instructions.Here are the instructions for making a smoothie:

1. Add fruit to the blender.

2. dd milk to the blender.

3. Put the lid on the blender.

4. Switch the blender on.

Imagine if we missed out one of the steps or reversed the order. We could end up switching on the blender with nothing in it. Or there could just be milk in the blender and no fruit.

That wouldn't make a very tasty smoothie, would it? In fact, it wouldn't make a smoothie at all!

Speaking a Computer's language

Computers won’t understand your algorithm as they use a different language.

It will need to be translated into code which the computer will then follow to complete a task.

This code is written in a programming language. There are many different types of programming languages.

Some that you may come across are Logo, Scratch, Blockly, Python and Kodu. Each of these languages are suited to different things.

Car park algorithm

As you can see, this is an algorithm based on a Car park. Most algorithms are layed out in a similar was to this.Take a look at the sequence of instructions shown in the flow chart. Can you see what is happening in this algorithm and explain how it works?

bottom of page