An algorithm is a finite, well-defined sequence of steps that takes some input and produces a result. It is the central object of computer science: nearly everything a computer does is the execution of one or more algorithms. The word itself comes from the name of the ninth-century mathematician al-Khwarizmi, whose writings introduced systematic methods of calculation to the wider world.
The intuitive meaning of an algorithm is captured by the logician’s notion of an effective method. The Stanford Encyclopedia of Philosophy describes such a method as one set out in a finite number of exact instructions, that produces the desired result in a finite number of steps if carried out without error, that a person could in principle carry out with only paper and pencil, and that “demands no insight, intuition, or ingenuity” from whoever follows it. In other words, an algorithm is a recipe so precise that following it requires no creativity.
Algorithms are usually described not in a specific programming language but in pseudocode or in plain mathematical terms, so that the method can be studied independently of any particular machine. The same algorithm can then be implemented in many languages and run on many computers.
Because algorithms are the heart of computing, much of the field is devoted to designing better ones and to understanding their limits. Donald Knuth’s The Art of Computer Programming made the careful study of algorithms, including exactly how much time and space they require, into a rigorous discipline.