Algorithm is the science of creating algorithms and processes, an essential component of structured programming. Drawing up a business plan, developing an application for a mobile or computer game will not do without algorithms. The ability to create algorithms allows you to do many things repeatedly, with a minimum of effort, in an automatic mode.
Instructions
Step 1
For the first time the word "algorithm" was used by one of the founders of modern algebra, the sage and astronomer Al-Khwarizmi back in 224 AD. in his fundamental works. In his understanding, an algorithm is an instruction that allows you to solve a problem. Al-Khwarizmi was a respected scientist among his colleagues, and the compilation of such instructions became the norm in the mathematical environment.
Step 2
Compilation of algorithms acquired the most important practical and applied role with the advent of computers. Huge vacuum tube machines were built for the purpose of calculating complex expressions and solving problems. A computer cannot think creatively, understanding only instructions (commands) in binary code. Algorithm in programming is a sequence of commands leading to the achievement of a result.
Step 3
In order to compose an algorithm, you first need to define a goal. Then you can formulate in your own words (and write down on paper, even if vaguely) how to achieve this goal.
Step 4
The main features of the algorithm are brevity of presentation, step-by-step stage-by-stage, comprehensibility for the performer. A good example of an algorithm is a recipe. Turn your vague description of achieving a goal into instructions, broken down into specific actions that move closer to achieving the goal. Teams should be clear, possible, non-questionable, and measurable. For example: “Take 2 eggs. Cook them for 10 minutes in a saucepan. Peel off the shell."
Step 5
To translate an algorithm into a program code, you need to simplify it as much as possible. Then you can rewrite it in "pseudocode" - in this language, all actions are performed in a programming style, but in human, not programmatic words. Upon completion, the pseudocode is translated into code in a programming language you know, and the program itself is compiled (executed by a computer).