Algorithm: Difference between revisions
imported>Pat Palmer (simplifying the intro) |
imported>Pat Palmer (→Introduction: working on the weird 2nd paragraph) |
||
Line 4: | Line 4: | ||
==Introduction== | ==Introduction== | ||
An algorithm consists of the | An algorithm consists of the steps to follow in solving a problem. When encoded in computer programs, algorithms operate on data values, preferably data maintained in a consistent [[data structure]]. Thus an algorithm is the recipe, while the data structure is the well-stored ingredients on which the recipe is designed to operate. | ||
Nicklaus Wirth, the inventor of the programming language Pascal, titled one of his books "Algorithms + Data Structures = Programs" (ISBN 0130224189) to indicate the complementary nature of algorithms and data structures, and their centrality to computing. | Nicklaus Wirth, the inventor of the programming language Pascal, titled one of his books "Algorithms + Data Structures = Programs" (ISBN 0130224189) to indicate the complementary nature of algorithms and data structures, and their centrality to computing. |
Revision as of 18:31, 1 September 2020
An algorithm is a sequence of steps for one particular method of solving a problem, similar to the instructions of a recipe when cooking. The word is derived from the name of al-Khwarizmi, a mathematician active in Baghdad in the 9th century CE.
Introduction
An algorithm consists of the steps to follow in solving a problem. When encoded in computer programs, algorithms operate on data values, preferably data maintained in a consistent data structure. Thus an algorithm is the recipe, while the data structure is the well-stored ingredients on which the recipe is designed to operate.
Nicklaus Wirth, the inventor of the programming language Pascal, titled one of his books "Algorithms + Data Structures = Programs" (ISBN 0130224189) to indicate the complementary nature of algorithms and data structures, and their centrality to computing.
Algorithms are usually expressed independently of the programming language, typically in terms of a brief, informal list of commands called pseudocode, or diagrammatically in the form of a flowchart.
Examples of different categories of algorithms used in computer programming include:
- Bounding limit
- Compression
- Conversion
- Encryption
- Fourier transform
- Geometric
- Graphic
- Numeric
- Probabilistic
- Searching
- Sorting
- Text string
Basic algorithm designs
There are several general methods for designing algorithms. Some of the most common are
- Divide and conquer strategies. These typically yield algorithms of complexity, or better.
- The greedy method.
- Dynamic programming.
Some well known algorithms
- Quicksort
- The fast fourier transform, also known as the fft.
- The Euclidean algorithm, known from number theory.