You are on page 1of 7

Algorithm Development

Algorithm is a step by step procedure which defines


a set of instructions to be executed in a certain
order to get a desired output.
Some important categories
Search
Sort
Insert
Update
Delete
Characteristic of an
Algorithm

Not all the procedures can be called as an algorithm.


It must have some characteristic.
Steps followed should very clear.
Input should be well defined.
Ouput should match the desiresoursed output.
Finiteness should terminate after the finite number
of steps.
Feasibility- should be feasible with the available
resourses
Independent should be independent of any
programming code.
How to write an Algorithm

There is well defined standards for writing


Algorithm
It is problem and resource dependent.

Complexity Analysis.

Algorithm Analysis
Apriori Analysis - Its the theoretical analysis,
the efficiency of the algorithm is calculated
theoretically like processing speed , machine
specification and have no effect on
implementation.
A posterior Analysis Its an emperical analysis,
ie running the program in the target machine
and find the efficiency by running time , space
needed.

Complexity
X algorithm
n Size of input
Time Factor measured by counting the number of
key
operation
Space Factor tell the space required to execute
the Alg.
Fixed part.
Variable part.
RECURSION
Some computer programming languages allow a
module or function to call itself.
A function a call itself.
Call b that it call a.
Then the function a is called recursive function.
eg , function call itself.
int function (int value)
{
if (value<1)
return;
function(value-1);
printf(%d, value);
}
Properties
Recursion function can go infinite like loop.
To avoid
Base criteria Giving a condition so that the
given
condition is met, the function stops
calling itself.
Progressive Approach the recursive call
should
progress in such a way the each time
a recursive call is made it come
closer
closer to the base criteria.
Implementation Many programming languages
implement
recursion by means of stacks.
whenever a function(caller) calls another
function(callee). The caller function transfers
execution control to the callee.
Analysis of recursion Time complexity
Space complexity

You might also like