In mathematics and computer science, an algorithm (from Algoritmi, the Latin form of Al-Khwārizmī) is a step-by-step procedure for calculations. More precisely, it is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning.
Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, will proceed through a finite number of well-defined successive states, eventually producing "output" and term...