Home Theory What is an Algorithm?

What is an Algorithm?

by nikoo28
0 comments 1 minutes read

Let us consider the problem of preparing an omelet. For preparing omelet, general steps we follow are:

1.>Get the frying pan.
2.>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 oil.
#If no, then we can terminate.

3.>Turn on the stove, etc…

What we are doing is, for a given problem (preparing an omelet), giving step by step procedure for solving it. Formal definition of an algorithm can be given as:-

An algorithm is the step-by-step instructions to solve a given problem.

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More