Algorithm: Characteristics of An Algorithm
Algorithm: Characteristics of An Algorithm
Algorithm: Characteristics of An Algorithm
The word Algorithm means “a process or set of rules to be followed in calculations or other
problem-solving operations”. Therefore Algorithm refers to a set of rules/instructions that step-
by-step define how a work is to be executed upon in order to get the expected results.
Characteristics of an Algorithm
Clear and Unambiguous: Algorithm should be clear and unambiguous. Each of its
steps should be clear in all aspects and must lead to only one meaning.
Well-Defined Inputs: If an algorithm says to take inputs, it should be well-defined
inputs.
Well-Defined Outputs: The algorithm must clearly define what output will be yielded
and it should be well-defined as well.
Finiteness: The algorithm must be finite, i.e. it should not end up in an infinite loops or
similar.
Feasible: The algorithm must be simple, generic and practical, such that it can be
executed upon will the available resources. It must not contain some future technology,
or anything.
Language Independent: The Algorithm designed must be language-independent, i.e. it
must be just plain instructions that can be implemented in any language, and yet the
output will be same, as expected.
Advantages of Algorithms:
It is easy to understand.
Algorithm is a step-wise representation of a solution to a given problem.
In Algorithm the problem is broken down into smaller pieces or steps hence, it is easier
for the programmer to convert it into an actual program.
Disadvantages of Algorithms:
1. Start.
2. Input two numbers a and b.
3. c = a + b.
4. Print c.
5. Stop.
Input: a, b, c
Output: avg
1. Start
2. Enter a, b, c.
3. avg = (a+b+c)/3
4. Print avg
5. Stop
Input: a, b, c
Output: a, b
1. Start
2. Enter a, b.
3. C=a
4. A=b
5. B=c
6. Print a, b
7. Stop
Input: a, b
Output: a, b
1. Start
2. Enter a, b.
3. A = a+b
4. B = a-b
5. A = a-b
6. Print a, b
7. Stop