What is an algorithm?
An algorithm is a work plan for solving a problem or task. When coding, an algorithm should be written so precise that a computer can do the task.
Every algorithm should ...
- Consist of simple, clear instructions
- Is formulated in a suitable language
- Is made in sequential steps
The algorithm, described in a language understandable to humans, is then translated into a programming language (for example, JAVA, PHP, or C). An algorithm coded in a programming language is called a source code.
Important algorithms are, for example:
- Sorting algorithms
- Search algorithms
- Paging algorithms (used when data is saved on computers)
Even in everyday life, there are many algorithms, such as cooking recipes, rules of the road, or other instructions. Below is an example of an everyday algorithm.
Example: Algorithm for powering up the computer
- Press the start button of the computer
- Start up the computer
- Choose an account
- Enter password (login)