Properties of Algorithm
Every algorithm must satisfy some properties-
1. Input: There should be 1 or more input supplied externally to the algorithm.
2. Output: There should be at list one output obtained.
3. Definiteness: Every step should be clear and well defined.
4. Finiteness: The algorithm should have finite number of states.
5. Correctness: Every step of the algorithm must generate a correct output.
An algorithm
is said to be efficient and fast if it takes less time to execute and consumers
less memory space. The performance of an algorithm is measured on the basis of
following properties -
1. Time complexity
2. Space complexity
The
complexity of an algorithm is the function that gives the running time and
space in terms of the input size.
No comments
Post a Comment