An algorithm is a plan, a set of step-by-step instructions to solve a problem. There are three basic building blocks (constructs) to use when designing algorithms:
These building blocks help to describe solutions in a form ready for programming.
Selection is a decision or question.
At some point in an algorithm there may need to be a question because the algorithm has reached a step where one or more options are available. Depending on the answer given, the algorithm will follow certain steps and ignore others.
Without selection, different paths would not be included in algorithms. This means that the solutions created would not be realistic.