An *algorithm* is a fixed sequence of commands that converts an input into a specific output. In a way, it is a bit like a recipe. Imagine you are baking a cake: you start with the ingredients, follow the recipe and end up with a cake.
![[algorithm_recipe.excalidraw.light.svg]]
Algorithms are very similar. You start with an input (e.g. an unsorted list of numbers)
![[sorting.excalidraw.light.svg]]
The algorithm acts as the recipe, a fixed sequence of steps, and you end up with a sorted list. Sometimes, there are different algorithms to obtain the same result. These different algorithms can be compares with means of [[Complexity Theory|complexity theory]].
>[!read]- Further Reading
>[[Quantum Algorithm]]
>[!ref]- References