PPT
PPT
KEY COMPOPNENT
• INTRODUCTION TO ALGORITHM
• CHARECTERSTIC OF ALGORITHM
• DEFINATION OF PSEUDO CODE
• EXAMPLE OF PSEUDO CODE
• PERFORMANCE ANALYSIS OF ALGORITHM
INTRODUCTION TO ALGORITHM
• Algorithm is a set of steps to complete a task.
• ‘’A set of steps to accomplish or complete a
task that is described precisely enough that a
computer can run it’’.
• An algorithm is a finite set of instructions that,
if followed, accomplishes a particular task.
• A program is the expression of an algorithm in
a programming language
COMPUTATIONAL PROCEDURE
PROBLEM
ALGORITHM
Algorithm arrayMax(A, n)
Input array A of n integers // to get input value in array
Output maximum element of A // to produce output in an max element
currentMax A[0]// intialize max=0
for I 1 to n-1 do // assign the value of I then loop will start
if A[i] > currentMax then // check the value of array is greater than
the value
currentMax A[i] // to store the max value
return currentMax// return value
PERFORMANCE ANALYSIS
Criteria for judging algorithms that have a more direct
relationship to performance
computing time
storage requirements.
1.SPACE COMPLEXITY
2. TIME COMPLEXITY
SPACE COMPLEXITY
• The space complexity of an algorithm is the
amount of memory it needs to run to
completion.
• The complexity of space is calculated by using
S(P)=C+SP
Where, S(P)= Space Complexity
C= Constant
SP=variable part
Components of Space complexity
• Instruction space
In order to store instruction
• Environmental stack
To store partially executed funtion
• Data space
Store varialabe and constant
Example of SPACE COMPLEXITY
Abc (x,y,z)
Return x*y*z+(x-y);
S(P)=C+SP
S(P)=3+0
=3