# Algorithms (Characteristics, Guidelines & Advantages)

## Algorithm Introduction

An algorithm is an effective step-by-step procedure for solving a problem in a finite number of steps. In other words, it is a finite set of well-defined instructions or step-by-step description of the procedure written in human readable language for solving a given problem. An algorithm itself is division of a problem into small steps which are ordered in sequence and easily understandable. Algorithms are very important to the way computers process information, because a computer program is basically an algorithm that tells computer what specific tasks to perform in what specific order to accomplish a specific task. The same problem can be solved with different methods. So, for solving the same problem, different algorithms can be designed. In these algorithms, number of steps, time and efforts may vary more or less.

## Characteristics of an Algorithm

An algorithm must possess following characteristics :

1. Finiteness: An algorithm should have finite number of steps and it should end after a finite time.
2. Input: An algorithm may have many inputs or no inputs at all.
3. Output: It should result at least one output.
4. Definiteness: Each step must be clear, well-defined and precise. There should be no any ambiguity.
5. Effectiveness: Each step must be simple and should take a finite amount of time.

## Guidelines for Developing an Algorithm

Following guidelines must be followed while developing an algorithm :

1. An algorithm will be enclosed by START (or BEGIN) and STOP (or END).
2. To accept data from user, generally used statements are INPUT, READ, GET or OBTAIN.
3. To display result or any message, generally used statements are PRINT, DISPLAY, or WRITE.
4. Generally, COMPUTE or CALCULATE is used while describing mathematical expressions and based on situation relevant operators can be used.

## Example of an Algorithm

Algorithm : Calculation of Simple Interest

```Step 1: Start
Step 2: Read principle (P), time (T) and rate (R)
Step 3: Calculate I = P*T*R/100
Step 4: Print I as Interest
Step 5: Stop
```

Designing an algorithm has following advantages :

1. Effective Communication: Since algorithm is written in English like language, it is simple to understand step-by-step solution of the problems.
2. Easy Debugging: Well-designed algorithm makes debugging easy so that we can identify logical error in the program.
3. Easy ann Efficient Coding: An algorithm acts as a blueprint of a program and helps during program development.
4. Independent of Programming Language: An algorithm is independent of programming languages and can be easily coded using any high level language.