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 designing 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.
https://stackoverflow.com/questions/487258/what-is-a-plain-english-explanation-of-big-o-notation
https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/
http://www.bbc.co.uk/guides/z3whpv4
Comments