What is Algorithm
Algorithm is well defined computational procedure that takes some values or set of values as input and produces some values as output. Means sequence of computational steps that transform input into output.
Set of instructions written in sequence in our language
Algorithm is finite set of instructions which if followed, accomplish particular task
Algorithm must satisfy following criteria
1- Input: there are one or more quantities which are externally supplied
2- Output: at least one quantity is produced
3- Definiteness- each instructions must be clear and unambiguous
4- Effectiveness- every instruction must be sufficiently basic that it can in principle be carried out by person
5- finiteness: algorithm must terminate after few steps
Algorithm is well defined computational procedure that takes some values or set of values as input and produces some values as output. Means sequence of computational steps that transform input into output
types of algorithms:
ITERATIVE( REPETITIVE): uses loops and conditional statements
RECURSIVE : it uses divide and conquer strategy
Here algorithm breaks down a large problem into small pieces then applies the algorithm to each of these small pieces
example:
SUM OF TWO NUMBERS:
1) display enter first number
2) accept n1
3) display enter second number
4) accept n2
5) sum = n1+n2
6) display sum
7) stop
Liked it










