0% found this document useful (0 votes)
21 views

PPT

The document provides an overview of algorithms, including their definition, characteristics, and the concept of pseudocode. It discusses performance analysis, focusing on time and space complexity, and outlines how to evaluate an algorithm's efficiency. An example of pseudocode for finding the maximum element in an array is also included.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

PPT

The document provides an overview of algorithms, including their definition, characteristics, and the concept of pseudocode. It discusses performance analysis, focusing on time and space complexity, and outlines how to evaluate an algorithm's efficiency. An example of pseudocode for finding the maximum element in an array is also included.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

ALGORITHM AND DESIGN ANALYSIS

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

INPUT COMPUTER OUTPUT


CHARACTERISTIC OF ALGORITHM
• Input:
Zero or more quantities are externally supplied.
• Output:
At least one quantity is produced.
• Definiteness:
Each instruction is clear and unambiguous.
• Finiteness:
The algorithm terminates after a finite number of steps.
• Effectiveness:
Every instruction must be very basic enough and must be
feasible.
PSEUDOCODE

• More structured than plain English.

• Less detailed than a program.


• Preferred notation for describing algorithms.
• Hides program design issues.
EXAMPLE OF PSEUDO CODE
• To find the max element of an array

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.

Performance evaluation can be loosely divided into two


major phases:
• a priori estimates
• a posteriori testing.
performance analysis and performance measurement
TYPE OF PERFORMANCE ANALAYSIS

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy