SlideShare a Scribd company logo
ALGORITHM ANALYSIS AND
EFFICIENCY
WHAT IS ALGORITHM?
 Algorithm is a step by step instruction to solve a
given problem.
 An Algorithm must have definite end point so that
when the input has been processed and the
desired output achieved,the process stops.
 Example:To add two numbers
Accept two numbers as num1 and num2
Find the sum of two numbers
PRINT SUM
Algorithm analysis and efficiency
WHY ALGORITHM ANALYSIS?
 A problem can have solution/multiple solutions.
 To establish if a given algorithm uses a
reasonable amount of resources to solve a
problem,an analysis of algorithm is required.
ALGORITHM EFFICIENCY
 Algorithmic efficiency are properties of algorithm
which relate to amount of computational
resources used by an algorithm.
 For maximum efficiency,we wish to minimise
resource usage.
MEASURES OF ALGORITHM EFFICIENCY
 Time Complexity(how long does algorithm take to
complete)
 Space complexity(how much working memory is
needed by algorithm)
This has two aspects
1.Amount of memory needed by the code
2.Amount of memory needed for data on
which the code operates.
There are also less common measures.They are
 Transmission size :Bandwidth could be a limiting
factor.Data compression can be used to reduce
amount of data to be transmitted.
 External risk :Space needed on a disk.
 Response Time :Particularly in realtime
applications when computer system must respond
quickly to some external extent.
 Total cost of Ownership:Particularly if computer
is dedicated to one particular algorithm.
THANK YOU!!!!

More Related Content

Algorithm analysis and efficiency

  • 2. WHAT IS ALGORITHM?  Algorithm is a step by step instruction to solve a given problem.  An Algorithm must have definite end point so that when the input has been processed and the desired output achieved,the process stops.  Example:To add two numbers Accept two numbers as num1 and num2 Find the sum of two numbers PRINT SUM
  • 4. WHY ALGORITHM ANALYSIS?  A problem can have solution/multiple solutions.  To establish if a given algorithm uses a reasonable amount of resources to solve a problem,an analysis of algorithm is required.
  • 5. ALGORITHM EFFICIENCY  Algorithmic efficiency are properties of algorithm which relate to amount of computational resources used by an algorithm.  For maximum efficiency,we wish to minimise resource usage.
  • 6. MEASURES OF ALGORITHM EFFICIENCY  Time Complexity(how long does algorithm take to complete)  Space complexity(how much working memory is needed by algorithm) This has two aspects 1.Amount of memory needed by the code 2.Amount of memory needed for data on which the code operates.
  • 7. There are also less common measures.They are  Transmission size :Bandwidth could be a limiting factor.Data compression can be used to reduce amount of data to be transmitted.  External risk :Space needed on a disk.  Response Time :Particularly in realtime applications when computer system must respond quickly to some external extent.  Total cost of Ownership:Particularly if computer is dedicated to one particular algorithm.