Algorithm
An algorithm is a sequence of instructions that are carried out in a predetermined sequence in
order to solve a problem or complete a work. They form the foundation of writing a program.
For writing any programs, the following has to be known:
• Input
• Tasks to be preformed
• Output expected
Features of the algorithm
It defines several important features of the algorithm, including:
1. Inputs: Algorithms must receive inputs that can be represented as values
or data.
2. Output: The algorithm should produce some output. It can be a
consequence of a problem or a solution designed to solve it.
3. Clarity: Algorithms must be precisely defined, using unambiguous
instructions that a computer or other system can follow unambiguously.
4. Finiteness: The algorithm requires limited steps. It means that it should be
exited after executing a certain number of commands.
5. Validity: The algorithm must be valid. In other words, it should be able to
produce a solution to the problem that the algorithm is designed to solve in a
reasonable amount of time.
6. Effectiveness: An algorithm must be effective, meaning that it must be able
to produce a solution to the problem it is designed to solve in a reasonable
amount of time.
Advantages of Algorithms:
1. It is a step-wise representation of a solution to a given problem,which
makes it easy to understand.
2. An algorithm uses a definite procedure.
3. It is not dependent on any programming language, so it is easy to
understand for anyone even without programming knowledge.
4. Every step in an algorithm has its own logical sequence so it is easy to
debug.
An algorithm is a sequence of instructions that are carried out in a predetermined sequence in
order to solve a problem or complete a work. They form the foundation of writing a program.
For writing any programs, the following has to be known:
• Input
• Tasks to be preformed
• Output expected
Features of the algorithm
It defines several important features of the algorithm, including:
1. Inputs: Algorithms must receive inputs that can be represented as values
or data.
2. Output: The algorithm should produce some output. It can be a
consequence of a problem or a solution designed to solve it.
3. Clarity: Algorithms must be precisely defined, using unambiguous
instructions that a computer or other system can follow unambiguously.
4. Finiteness: The algorithm requires limited steps. It means that it should be
exited after executing a certain number of commands.
5. Validity: The algorithm must be valid. In other words, it should be able to
produce a solution to the problem that the algorithm is designed to solve in a
reasonable amount of time.
6. Effectiveness: An algorithm must be effective, meaning that it must be able
to produce a solution to the problem it is designed to solve in a reasonable
amount of time.
Advantages of Algorithms:
1. It is a step-wise representation of a solution to a given problem,which
makes it easy to understand.
2. An algorithm uses a definite procedure.
3. It is not dependent on any programming language, so it is easy to
understand for anyone even without programming knowledge.
4. Every step in an algorithm has its own logical sequence so it is easy to
debug.