What is Algorithm Programming? Definition, Example
The word algorithm originates from the Arabic word “Algorithm” which stems from the name of a famous Arabic mathematical Abu Jafar Mohammed Ibu Musa AL Khwarizmi (A.D. 825) who first suggests a mechanical model for adding two number represented in the Hindi neutral system.
An algorithm named after ninth-century mathematician AL-Khowarizmi is defined as follow:
An algorithm is a set of rules for carrying out calculations either by hand or on a machine.
finally, its a sequence of computational steps that transform the input into the output.
sop, the algorithm is also a sequence of operations performed on data that have to be organized in data structures.
First of all, An algorithm is an obstruction of a program to be executed on a physical machine.
Definition of Algorithm Programming
Set of instructions that can perform a specific task is known as an algorithm. It has the following properties:
An algorithm terminates after a finite number of steps that is, when the algorithm is executed, it comes to a stop after executing a finite number of steps.
Each step of the algorithm is precisely defined, i.e. the actions to be carried out are rigorously and unambiguously specified and the sequence of steps to be executed is also unambiguously specified.
The algorithm should be complete so that it can solve all the problems of the same type for which it is being designed.
All the operations used in the algorithm are basic and feasible so that it can be implemented on the computer.
(5) Input/ Output:
An algorithm has certain precise inputs or initial data and the outputs are generated in the intermediate as well as the final steps of the algorithm.
therefore, Suppose you want to write a program to calculate the perimeter of a rectangle.
To calculate the rectangle’s perimeter we need length and width. Now we write an algorithm to calculate this task.
Step 1: Input the length of a rectangle, we receive it from the length variable. In Step 2: Input width of a rectangle, we receive it from the width variable. Next Step 3: area = 2 X (length + Width) Step 4: Print area Finally Step 5: Exit
As a result Explanation:
In step (1) we have received the value of length from length variable. In step (2) we have collected the value of width from width variable. In step (3) we have computed the perimeter of the rectangle by using the formula and the resultant is stored in the variable area. In step (4) we have displayed the value of perimeter. In step (5) Algorithm stops.
therefore, This algorithm has all five properties of the algorithm.
Note: set of instruction processing the above five properties: (a) Finiteness (b) Definiteness (c) Completeness Generally (d) Effectiveness (e) Input-output