DefinitionsThere are various definitions available for term Algorithm as: - "
**A set of rules for solving a problem in a finite number of steps**" - Dictionary - "
**A set of steps that are followed in order to solve a mathematical problem or to complete a computer process**" - Merriam-Webster - "
**An Algorithm is any well defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values as output**"- refer to References - "
**A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.**" - Google
Any of the above mentioned definition will work, and even all definitions provides a similar summary i.e. a set of well defined steps to solve a defined problem corresponding to provided inputs.
**Input**: Accept Zero or more inputs externally.**Output**: Must produce at least one output as result of procedure.**Definiteness**: Each instruction must be clear and unambiguous.**Finiteness**: If all the instructions are traced in algorithm, then for all cases the algorithm must terminate after a finite number of steps.**Effectiveness**: Every instruction must be very basic so that it can be carried out and must be feasible to perform on any machine.
One important point about algorithm, it is not a computer program. Instead it is a procedure written as pseudo code or English language type description, providing information about what calculations are to be performed and in which flow.
` 1. Ask user to enter two integer numbers.` ` 2. Add both the integer numbers.` ` 3. Print the final sum value of two numbers`
` ` ` ` `Algorithm` ` SUM` ` ` ` ` `Input: ` `Two Integer Numbers as ONE, TWO` ` ` ` ` ` ` `Output` `: sum of ONE & TWO as RESULT` ` ` ` ` `ONE <- User input required` ` ` ` ` `TWO <- User input required` ` ` ` ` `RESULT <- ONE + TWO` ` ` ` ` `return RESULT` Even
for some cases all the three types of defining the algorithm is used. I
depends on what kind of document you are working on. |