Algorithm
What is an Algorithm?
• An algorithm is a process or a set of rules required to
perform calculations or some other problem-solving
operations.
• Contains the finite set of instructions which are being
carried in a specific order to perform the specific task.
• It is not the complete program or code; it is just a
solution (logic) of a problem
• Transforms input of a problem to output
Algorithm = Input + Process + Output
Algorithm
Characteristics of an Algorithm
The following are the characteristics of an algorithm:
• Input
• Output
• Unambiguity
• Finiteness
• Effectiveness
• Language Independent
Algorithm
Why do we need algorithm?
• Scalability
• Performance
Any real time example
Algorithm
Factors of Algorithm:
Consider during Algorithm Design:
• Modularity
• Correctness
• Maintainability
• Functionality
• Robustness
• User friendly
• Extensibility
Algorithm
Categories of Algorithm:
• Sort
• Search
• Insert
• Delete
• Update
Analysis of Algorithm
2 levels of Analysis
1. Priori Analysis
Theoretical analysis
Done before implementing the algorithm
2. Posterior Analysis
Practical analysis
Achieved by using any programming language
How much running time and space
Asymptotic notations
• The efficiency of an algorithm depends on the amount of
time, storage and other resources required to execute the
algorithm.
• The efficiency is measured with the help of asymptotic
notations.
• Algorithm not have same performance for different input
types
• “The study of change in performance of the algorithm
with the change in the order of the input size is defined as
asymptotic analysis”.
Asymptotic notations
• Mathematical notations
• Describe running time of algorithm
• There are mainly three asymptotic notations:
1. Big-O notation
2. Omega notation
3. Theta notation
Analysis of Algorithm
It is determination of amount of time and space
Generally perform following types of analysis:
Worst case – Big Oh (MAX)
Best case - Big Omega
Average case – Big Theta
Amortized – Overall cost

Analysis of Algorithm data structure.ppt

  • 1.
    Algorithm What is anAlgorithm? • An algorithm is a process or a set of rules required to perform calculations or some other problem-solving operations. • Contains the finite set of instructions which are being carried in a specific order to perform the specific task. • It is not the complete program or code; it is just a solution (logic) of a problem • Transforms input of a problem to output Algorithm = Input + Process + Output
  • 2.
    Algorithm Characteristics of anAlgorithm The following are the characteristics of an algorithm: • Input • Output • Unambiguity • Finiteness • Effectiveness • Language Independent
  • 3.
    Algorithm Why do weneed algorithm? • Scalability • Performance Any real time example
  • 4.
    Algorithm Factors of Algorithm: Considerduring Algorithm Design: • Modularity • Correctness • Maintainability • Functionality • Robustness • User friendly • Extensibility
  • 5.
    Algorithm Categories of Algorithm: •Sort • Search • Insert • Delete • Update
  • 6.
    Analysis of Algorithm 2levels of Analysis 1. Priori Analysis Theoretical analysis Done before implementing the algorithm 2. Posterior Analysis Practical analysis Achieved by using any programming language How much running time and space
  • 7.
    Asymptotic notations • Theefficiency of an algorithm depends on the amount of time, storage and other resources required to execute the algorithm. • The efficiency is measured with the help of asymptotic notations. • Algorithm not have same performance for different input types • “The study of change in performance of the algorithm with the change in the order of the input size is defined as asymptotic analysis”.
  • 8.
    Asymptotic notations • Mathematicalnotations • Describe running time of algorithm • There are mainly three asymptotic notations: 1. Big-O notation 2. Omega notation 3. Theta notation
  • 9.
    Analysis of Algorithm Itis determination of amount of time and space Generally perform following types of analysis: Worst case – Big Oh (MAX) Best case - Big Omega Average case – Big Theta Amortized – Overall cost