Properties of an Algorithm
An Algorithm is considered a well-defined set of instructions to solve any problem. A good Algorithm must have these 5 essential properties:
1. Finiteness
- What does it mean? The Algorithm should stop after a limited number of steps. It should not get stuck in an infinite loop.
- In simple terms: No matter what the input is, the Algorithm should finish its work and give a result. It should not run forever.
2. Definiteness
- What does it mean? Every step of the Algorithm should be defined clearly and unambiguously.
- In simple terms: Every instruction should be so clear that the person performing it does not have to think, "What should I do now?" Every operation should be precise.
3. Input
- What does it mean? The Algorithm should be given zero or more external quantities, which are called Input.
- In simple terms: The Algorithm needs some starting data or initial conditions to start its work. For example, if you are creating an Algorithm to add two numbers, those two numbers will be the Input.
4. Output
- What does it mean? The Algorithm should produce at least one quantity, which is called Output.
- In simple terms: The main purpose of the Algorithm is to solve the problem. The result obtained as a solution is called Output. There is no point in creating an Algorithm without Output.
5. Effectiveness
- What does it mean? Every operation of the Algorithm should be fundamentally basic so that it can be effectively done with a pencil and paper in principle.
- In simple terms: The instructions of the Algorithm should be such that they can be easily and reliably executed. There should be no impossible or unspecified operations in it.
Additional Property
Efficiency
- What does it mean? An Algorithm should be efficient, meaning it should use minimum time and minimum memory space.
- In simple terms: If you have two different Algorithms to do the same task, you will choose the one that is faster and uses fewer resources.
Comments
Post a Comment