An algorithm is a set of rules which are designed to help us solve a problem. You could argue a whole system is one big algorithm, but we tend to think about them as more granular.
As mentioned in the BBC Bitesize video (below), it’s important to design the algorithm before you start to code. If you watch the bitesize video, they talk about the act of brushing your teeth. So we have to design the algorithm first before implementing the code.
Taking the above scenario for brushing your teeth, once we have the outline, we can look at sdsigning and implementing an algorithm that will address the steps and ideas of the process.
Now, the above scenario also shows the difficulty with programming and automation. The majority of readers here will probably be testers, so will have seen many test cases similar to the above. We could pick many holes in this algorithm, such as:
We could go on. I added this because programming is difficult, but to also emphasize the huge difference between designing and implementing code.
I thought about explaining this, but quite frankly I cannot do as good a job as ‘cletus’ on StackOverflow.
In short, big-o-notation is a model to describe the complexity of an algorithm. I encourage you to check out the explanation linked above.