Algorithms are sets of step-by-step instructions for the computer to follow. They are at the heart of all computer programs.
You can think of an algorithm as similar to a recipe for making something to eat.
If you make a sandwich, you follow a set of steps to put the different ingredients together.
- You bring ingredients together
- Assemble them as you like
- Produce a final product – the sandwich.
If you were asked to write down instructions to make a sandwich, you could create a written algorithm.