An **algorithm** is the description of a procedure to solve a certain (mathematical) problem. Typically, an algorithm consists of a series of actions that have to be done plus an indication of whether and when they are to be repeated. One could see an algorithm as a rough form of a computer program.

**Related topics**:
### References

The word *algorithm* is a corruption of the word *algorism* which came from the name of Abu Ja'far Mohammed ibn Musa al-Khwarizmi (ca. 780 - ca. 850). He was the author of the book "*Kitab al-jabr w'al-muqabala*" (*Rules of Restoration and Reduction*) which introduced algebra to people in the West. The word *algebra* itself originates from *al-Jabr* from the book title. The word "algorism" orignally referred only to the rules of performing arithmetic using Arabic numerals, but evolved into "algorithm" by the eighteenth century. The word has nowadays evolved to include all definite procedures for solving problems, including cooking :)

As an example of an algorithm, here is one given to us by Euclid, and thus known as Euclid's Algorithm, for finding the greatest common divisor (GCD) of two positive integers A and B:

- Let A be the greater number of A and B, and B the lesser.
- Let A = A-B.
- Repeat steps 1 and 2 until A and B are equal, this number will then be the greatest common divisor of the original numbers.

Algorithms come in different flavours. A [greedy algorithm]? works by making a series of simple decisions that are never reconsidered. A [divide-and-conquer algorithm]? recursively reduces an instance of a problem to one or more smaller instances of the same problem, until the instances are small enough. A [dynamic programming algorithm]? works bottom-up by building progressively larger solutions to subproblems arising from the original problem, and then uses those solutions to obtain the final result. Many problems (such as playing chess) can be modeled as problems on graph?s. A [graph exploration algorithm]? specifies rules for moving around a graph and is useful for such problems. Sometimes we are willing to tolerate a probability that the procedure will fail. This is where [probabilistic algorithm]?s come into play. Finally, [parallel algorithm]?s takes advantage of the availability of multiple processors to speed up the solution process.

Usually one is not only concerned with how to perform the work but also wishes to know how much of particular resources (such as time or storage) will be needed. Methods have been developed for the analysis of algorithms to obtain such quantitative answers.

- Algorithmics?
- Bulletproof Algorithms
- Numerical analysis
- Cryptographic algorithms
- Sorting algorithms
- Search algorithms
- Merge
- String algorithms
- Algorithms on Wikipedia

- Donald E Knuth:
*The Art of Computer Programming*, Vol 1-3, Addison Wesley 1998. The standard reference. - Gaston H. Gonnet and Ricardo Baeza-Yates: Example programs from
*Handbook of Algorithms and Data Structures*, http://www.dcc.uchile.cl/~rbaeza/handbook/hbook.html. Free source code for lots of important algorithms.