Answer the question
In order to leave comments, you need to log in
Can any piece of program code be considered an algorithm?
Hello!
I understand that the question is essentially fundamental, but it would be interesting to understand it in a little more detail.
The algorithm has a definition and properties:
An algorithm is a system of precise and understandable instructions about the content and sequence of performing a finite number of actions necessary to solve any problem of a given type.
Examples: rules for addition, multiplication, solving algebraic equations, etc.
Properties of the algorithm:
1. Universality (mass character) - the applicability of the algorithm to various sets of initial data.
2.Discreteness - the process of solving the problem according to the algorithm is divided into separate actions.
3. Finiteness - each of the actions and the entire algorithm as a whole must be completed.
4. Efficiency - upon completion of the algorithm, the final result is necessarily obtained.
5.Practicability (efficiency) - the result of the algorithm is achieved in a finite number of steps.
6. Determinacy (definiteness) - the algorithm should not contain prescriptions, the meaning of which can be perceived ambiguously. Those. the same prescription, when executed, must produce the same result.
7. Sequence - the order of execution of commands should be clear to the performer and should not allow ambiguity.
Answer the question
In order to leave comments, you need to log in
1. Is it possible to write code that is not an algorithm?
2. Is an instruction with a single action an algorithm?
3. Is layout an algorithm and can it be considered code at all?
1. Is it possible to write code that is not an algorithm?
Yes, if it violates one of the seven principles
2. Is an instruction with a single action an algorithm?
I think so
3. Is layout an algorithm and can it be considered code at all?
I think so, because does not violate principles 1 - 7
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question