**What is Algorithm? **

An algorithm is defined as a step-by-step procedure or method for solving a problem.

Let us consider the problem of preparing a bajji. To prepare a bajji, we follow the given below steps given:

- Get the frying pan.
- Get the oil.
- Do we have oil?
- If yes, put it in the pan.
- If no, do we want to buy oil?
- If yes, then go out and buy.
- If no, we can terminate.

- Do we have oil?
- Turn on the stove, etc…

What we are doing is, for a given problem (preparing a bajji), we are providing a step-by-step procedure for solving it.

While defining an algorithm steps are written in human understandable language and independent of any programming language. We can implement it in any programming language of our choice. From the data structure point of view, following are some important categories of algorithms

**Sort –**Algorithm to sort items in a certain order (Either Ascending/Descending order).**Search –**Algorithm to search an item in a data structure.**Insert –**Algorithm to insert item in a data structure.**Update –**Algorithm to update an existing item in a data structure.**Delete –**Algorithm to delete an existing item from a data structure.

**Characteristics of an Algorithm **

Not all procedures can be called an algorithm. An algorithm should have the following characteristicsΒ

**Unambiguous**– Algorithm should be clear and unambiguous. Each of its steps and their inputs/outputs should be clear and must lead to only one meaning.**Effectiveness**– An algorithm is also generally expected to be effective. This means that all of the operations to be performed in the algorithm must be sufficiently basic that they can in principle be done exactly and in a finite length of time.**Input –**An algorithm should have zero or more well-defined inputs.**Output –**An algorithm should have 1 or more well-defined outputs, and should match the desired output.**Finiteness –**Algorithms must terminate after a finite number of steps.**Feasibility –**Should be feasible with the available resources.**Independent –**An algorithm should have step-by-step directions, which should be independent of any programming code.