A series of actions performed in a specific order is called sequence. For example, our daily routine. Our daily routine is a series of actions that we do every day as follows.
1. Wake up.
2. Have breakfast.
3. Take a shower.
4. Go to school.
5. Attend classes.
6. Have lunch.
7. Attend classes.
8. Get back home.
9. Do homework.
10. Watch TV.
11. Have dinner.
12. Go to sleep.
However, this routine might vary from person to person but for a specific person this might be the routine.
An algorithm is a set of steps to solve a problem. A program is written based on an algorithm to get the required result.
Sequencing in algorithms is arranging the steps of an algorithm in a correct sequence so that we get the correct outcome. Sequencing is important in algorithms. If the steps of an algorithm are not in correct sequence, we will not get the required result.
For example, if we make a simple algorithm of calculating the sum of two numbers, the steps would look like as the following in a flowchart.
If we swap 2 steps and add Num1 and Num2 before taking Num1 as input, the program will not give the required result or give an error. This is called a bug.