◑ GROWING NOTE algorithmscs-fundamentals
Algorithm
A finite set of procedural steps transforming specific inputs to specific outputs.
A finite set of procedural steps transforming specific inputs to specific outputs.
An algorithm is a finite set of procedural and elementary computational steps to transform a specific set of inputs to a specific set of outputs.
More technically, for a set of inputs and a set of outputs , an algorithm is a function where inputs are mapped to outputs.
Algorithms are designed, analyzed and optimized on the theoretical basis of a model of computation and operate within those specifications.
Algorithm efficiency is measured in terms of time and space as functions of input size :
| Notation | Name | Example |
|---|---|---|
| Constant | Array access | |
| Logarithmic | Binary search | |
| Linear | Linear scan | |
| Linearithmic | Merge sort | |
| Quadratic | Bubble sort | |
| Exponential | Subset enumeration |