Asymptotic Notations and Complexity Analysis
Asymptotic Notations and Complexity Analysis
By
Arvind Kumar
Asst. Professor,
Lovely Professional University, Punjab
Contents
• Basic Terminology
• Complexity of Algorithm
• Asymptotic Notations
• Review Questions
Basic Terminology
• Algorithm: is a finite step by step list of well-defined
instructions for solving a particular problem.
Specification of Output
Specification of Input
(e.g. any sequence of natural Algorithm as a function of Input
numbers) (e.g. sequence of sorted
natural numbers)
Characteristics of Good Algorithm
• Efficient
• Running Time
• Space used
• Worst Case: The maximum value of f(n) for any possible input.
Example:
• 50n log n is O(n log n)
• 8n2 log n + 5 n2 + n is O(n2 log n)
Big-Omega (Ω) Notation
• Asymptotic lower bound
• O(√n) Time Complexity.
Questions
Review Questions
• When an algorithm is said to be better than the
other?