What is an Algorithm?

Learn about the different characteristics that make an algorithm effective.

An algorithm is an explicit, precise, unambiguous, mechanically executable sequence of elementary instructions, usually intended to accomplish a specific purpose. For example, here is an algorithm for singing that annoying song “99 Bottles of Beer on the Wall” for arbitrary values of the starting number of beer bottles:

Algorithm


BottlesofBeer(n)    For in down to 1Sing “i bottles of beer on the wall, i bottles of beer,Sing “Take one down, pass it around, i1 bottles of ...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy