SlideShare une entreprise Scribd logo
UCSE010 - DESIGN AND ANALYSIS OF ALGORITHMS
1
Dr.Nisha Soms/SRIT
Semester-06/2020-2021
• There are three types of analysis that we
perform on a particular algorithm.
• Best Case indicates the minimum time required for
program execution.
• For example, the best case for a sorting algorithm would be
data that's already sorted.
2
Dr.Nisha Soms/SRIT
• Average Case indicates the average time required for
program execution.
• Finding average case can be very difficult.
• Worst Case indicates the maximum time required for
program execution.
• For example, the worst case for a sorting algorithm might
be data that's sorted in reverse order (but it depends on the
particular algorithm).
3
Dr.Nisha Soms/SRIT
4
Dr.Nisha Soms/SRIT
Ref: https://www.cse.iitd.ac.in/~mausam/courses/col106/autumn2017/lectures/02-
asymptotic.pdf
 The standard notations used to define the time
required and the space required by the algorithm.
 The word Asymptotic means approaching a value or
curve arbitrarily closely (i.e., as some sort of limit is
taken).
 There are three types of asymptotic notations to
represent the growth of any algorithm, as input
increases:
▪ Big Theta (Θ)
▪ Big Oh(O)
▪ Big Omega (Ω)
5
Dr.Nisha Soms/SRIT
6
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 f(n) is O(g(n)), if there exists constants c and
n0 , s.t. f(n) ≤ c g(n) for all n ≥ n0
 f(n) and g(n) are functions over non-negative
integers
7
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 The notation Ο(n) is the formal way to express
the upper bound of an algorithm's running
time.
 It measures the worst case time complexity
or the longest amount of time an algorithm can
possibly take to complete.
8
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 f(n) is Ω(g(n)) if there exists constants c and
n0, such that c g(n) ≤ f(n) for n ≥ n 0
9
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 The notation Ω(n) is the formal way to express
the lower bound of an algorithm's running
time.
 It measures the best case time complexity or
the best amount of time an algorithm can
possibly take to complete.
1
0
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 f(n) is Ɵ(g(n)) if there exists constants c1 , c2 ,
and n0, such that c1 g(n) ≤ f(n) ≤ c2 g(n) for n
≥ n0
1
1
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 The notation θ(n) is the formal way to express
both the lower bound and the upper bound of
an algorithm's running time.
 It measures the average case time complexity
average amount of time an algorithm can
possibly take to complete.
 Given f(n) and g(n), which grows faster?
 If Lim n→∞ f(n)/g(n) = 0, then g(n) is faster
 If Lim n→∞ f(n)/g(n) = ∞, then f(n) is faster
 If Lim n→∞ f(n)/g(n) = non-zero constant,
then both grow at the same rate
 Solved Problems are available in
https://www.cse.wustl.edu/~sg/CS241_FL99/h
w1-practice.html
Semester-06/2020-2021 Dr.Nisha Soms/SRIT 12
1
3
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 General Property:
If f(n) is O(g(n)) then a*f(n) is also O(g(n)) ; where a is a
constant.
 Example:
f(n) = 2n²+5 is O(n²) then 7*f(n) = 7(2n²+5)
= 14n²+35 is also O(n²)
 Similarly, this property satisfies both Θ and Ω notation.
 We can say
 If f(n) is Θ(g(n)) then a*f(n) is also Θ(g(n)); where a is a constant.
 If f(n) is Ω (g(n)) then a*f(n) is also Ω (g(n)); where a is a
constant.
1
4
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 Reflexive Property:
If f(n) is given then f(n) = O(f(n))
 Example:
If f(n) = n3 ⇒ O(n3)
 Similarly,
 f(n) = Ω(f(n))
 f(n) = Θ(f(n))
1
5
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 Transitive Property:
If f(n) is O(g(n)) and g(n) is O(h(n)) then f(n) =
O(h(n)) .
 Example: if f(n) = n , g(n) = n² and h(n)=n³
n is O(n²) and n² is O(n³) then n is O(n³)
 Similarly this property satisfies for both Θ and Ω
notation.
 We can say
 If f(n) is Θ(g(n)) and g(n) is Θ(h(n)) then f(n) = Θ(h(n))
 If f(n) is Ω (g(n)) and g(n) is Ω (h(n)) then f(n) = Ω (h(n))
1
6
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 Symmetric Property:
If f(n) is Θ(g(n)) then g(n) is Θ(f(n)) .
 Example: f(n) = n² and g(n) = n² then f(n) =
Θ(n²) and g(n) = Θ(n²)
This property only satisfies for Θ notation.
1
7
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 Transpose Symmetric Property:
If f(n) is O(g(n)) then g(n) is Ω (f(n)).
 Example: f(n) = n , g(n) = n² then n is O(n²)
and n² is Ω (n)
This property only satisfies for O and Ω
notations.
1
8
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 Transpose Symmetric Property:
If f(n) is O(g(n)) then g(n) is Ω (f(n)).
 Example: f(n) = n , g(n) = n² then n is O(n²)
and n² is Ω (n)
This property only satisfies for O and Ω
notations.
1
9
Semester-06/2020-2021 Dr.Nisha Soms/SRIT
 If f(n) = O(g(n)) and f(n) = Ω(g(n)) then f(n) = Θ(g(n))
 If f(n) = O(g(n)) and d(n)=O(e(n))
then f(n) + d(n) = O( max( g(n), e(n) ))
 Example: f(n) = n i.e O(n), d(n) = n² i.e O(n²)
then f(n) + d(n) = n + n² i.e O(n²)
 If f(n)=O(g(n)) and d(n)=O(e(n)) then
f(n) * d(n) = O( g(n) * e(n) )
 Example: f(n) = n i.e O(n), d(n) = n² i.e O(n²)
then f(n) * d(n) = n * n² = n³ i.e O(n³)
 Solved Problems are available in
https://www.cse.wustl.edu/~sg/CS241_FL99/h
w1-practice.html
Semester-06/2020-2021 Dr.Nisha Soms/SRIT 20
 https://dotnettutorials.net/lesson/properties-of-
asymptotic-notations/
 https://unacademy.com/lesson/properties-of-
asymptotic-notation-part-1/1F2FTIU0
 https://www.cse.iitd.ac.in/~mausam/courses/col1
06/autumn2017/lectures/02-asymptotic.pdf
 https://www.cse.iitd.ac.in/~pkalra/col100/slides/1
0-Efficiency.pdf
 https://www.cse.wustl.edu/~sg/CS241_FL99/hw1
-practice.html
Semester-06/2020-2021 Dr.Nisha Soms/SRIT 21
Please Click Like, Share and Subscribe !
Semester-06/2020-2021 Dr.Nisha Soms/SRIT 22

Contenu connexe

Tendances

Algorithm big o
Algorithm big oAlgorithm big o
Algorithm big o
Ashim Lamichhane
 
Divide and conquer strategy
Divide and conquer strategyDivide and conquer strategy
Divide and conquer strategy
Nisha Soms
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis
Onkar Nath Sharma
 
Analysis of algorithn class 3
Analysis of algorithn class 3Analysis of algorithn class 3
Analysis of algorithn class 3
Kumar
 
Computational Complexity
Computational ComplexityComputational Complexity
Computational Complexity
Kasun Ranga Wijeweera
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihm
Sajid Marwat
 
Basic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV SyllabusBasic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV Syllabus
NANDINI SHARMA
 
Time complexity
Time complexityTime complexity
Time complexity
Katang Isip
 
asymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysisasymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysis
Anindita Kundu
 
Analysis Of Algorithms I
Analysis Of Algorithms IAnalysis Of Algorithms I
Analysis Of Algorithms I
Sri Prasanna
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
أحلام انصارى
 
Design and Analysis of algorithms
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
Dr. Rupa Ch
 
Asymptotic Analysis
Asymptotic AnalysisAsymptotic Analysis
Asymptotic Analysis
sonugupta
 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notations
Rajendran
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
Amrinder Arora
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
Soujanya V
 
Lecture 5: Asymptotic analysis of algorithms
Lecture 5: Asymptotic analysis of algorithmsLecture 5: Asymptotic analysis of algorithms
Lecture 5: Asymptotic analysis of algorithms
Vivek Bhargav
 
Lec 5 asymptotic notations and recurrences
Lec 5 asymptotic notations and recurrencesLec 5 asymptotic notations and recurrences
Lec 5 asymptotic notations and recurrences
Ankita Karia
 
Algorithum Analysis
Algorithum AnalysisAlgorithum Analysis
Algorithum Analysis
Ain-ul-Moiz Khawaja
 

Tendances (20)

Algorithm big o
Algorithm big oAlgorithm big o
Algorithm big o
 
Divide and conquer strategy
Divide and conquer strategyDivide and conquer strategy
Divide and conquer strategy
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis
 
Analysis of algorithn class 3
Analysis of algorithn class 3Analysis of algorithn class 3
Analysis of algorithn class 3
 
Computational Complexity
Computational ComplexityComputational Complexity
Computational Complexity
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihm
 
Basic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV SyllabusBasic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV Syllabus
 
Time complexity
Time complexityTime complexity
Time complexity
 
asymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysisasymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysis
 
Analysis Of Algorithms I
Analysis Of Algorithms IAnalysis Of Algorithms I
Analysis Of Algorithms I
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
 
Design and Analysis of algorithms
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
 
Asymptotic Analysis
Asymptotic AnalysisAsymptotic Analysis
Asymptotic Analysis
 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notations
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
 
Lecture 5: Asymptotic analysis of algorithms
Lecture 5: Asymptotic analysis of algorithmsLecture 5: Asymptotic analysis of algorithms
Lecture 5: Asymptotic analysis of algorithms
 
Lec 5 asymptotic notations and recurrences
Lec 5 asymptotic notations and recurrencesLec 5 asymptotic notations and recurrences
Lec 5 asymptotic notations and recurrences
 
Algorithum Analysis
Algorithum AnalysisAlgorithum Analysis
Algorithum Analysis
 

Similaire à Asymptotic analysis

Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
NagendraK18
 
Measuring algorithm performance
Measuring algorithm performanceMeasuring algorithm performance
Measuring algorithm performance
HabitamuAsimare
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
Nisha Soms
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptx
KarthikVijay59
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using C
Meghaj Mallick
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
Mallikarjun Biradar
 
lecture 1
lecture 1lecture 1
lecture 1
sajinsc
 
Theta notation
Theta notationTheta notation
Theta notation
Rajesh K Shukla
 
Searching.pptx
Searching.pptxSearching.pptx
Searching.pptx
VenkataRaoS1
 
Ch-2 final exam documet compler design elements
Ch-2 final exam documet compler design elementsCh-2 final exam documet compler design elements
Ch-2 final exam documet compler design elements
MAHERMOHAMED27
 
Design and analysis of ra sort
Design and analysis of ra sortDesign and analysis of ra sort
Design and analysis of ra sort
ijfcstjournal
 
Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02
mansab MIRZA
 
Master’s theorem Derivative Analysis
Master’s theorem Derivative AnalysisMaster’s theorem Derivative Analysis
Master’s theorem Derivative Analysis
IRJET Journal
 
Complexity
ComplexityComplexity
Complexity
A. S. M. Shafi
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
Tanya Makkar
 
C3L2_The Derivative_G12A.pptx
C3L2_The Derivative_G12A.pptxC3L2_The Derivative_G12A.pptx
C3L2_The Derivative_G12A.pptx
karan11dhawan
 
A survey on parallel corpora alignment
A survey on parallel corpora alignment A survey on parallel corpora alignment
A survey on parallel corpora alignment
andrefsantos
 
Weekends with Competitive Programming
Weekends with Competitive ProgrammingWeekends with Competitive Programming
Weekends with Competitive Programming
NiharikaSingh839269
 
Skiena algorithm 2007 lecture09 linear sorting
Skiena algorithm 2007 lecture09 linear sortingSkiena algorithm 2007 lecture09 linear sorting
Skiena algorithm 2007 lecture09 linear sorting
zukun
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
Venkatesh Iyer
 

Similaire à Asymptotic analysis (20)

Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Measuring algorithm performance
Measuring algorithm performanceMeasuring algorithm performance
Measuring algorithm performance
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptx
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using C
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
lecture 1
lecture 1lecture 1
lecture 1
 
Theta notation
Theta notationTheta notation
Theta notation
 
Searching.pptx
Searching.pptxSearching.pptx
Searching.pptx
 
Ch-2 final exam documet compler design elements
Ch-2 final exam documet compler design elementsCh-2 final exam documet compler design elements
Ch-2 final exam documet compler design elements
 
Design and analysis of ra sort
Design and analysis of ra sortDesign and analysis of ra sort
Design and analysis of ra sort
 
Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02
 
Master’s theorem Derivative Analysis
Master’s theorem Derivative AnalysisMaster’s theorem Derivative Analysis
Master’s theorem Derivative Analysis
 
Complexity
ComplexityComplexity
Complexity
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
 
C3L2_The Derivative_G12A.pptx
C3L2_The Derivative_G12A.pptxC3L2_The Derivative_G12A.pptx
C3L2_The Derivative_G12A.pptx
 
A survey on parallel corpora alignment
A survey on parallel corpora alignment A survey on parallel corpora alignment
A survey on parallel corpora alignment
 
Weekends with Competitive Programming
Weekends with Competitive ProgrammingWeekends with Competitive Programming
Weekends with Competitive Programming
 
Skiena algorithm 2007 lecture09 linear sorting
Skiena algorithm 2007 lecture09 linear sortingSkiena algorithm 2007 lecture09 linear sorting
Skiena algorithm 2007 lecture09 linear sorting
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
 

Dernier

LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 

Dernier (20)

LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 

Asymptotic analysis

  • 1. UCSE010 - DESIGN AND ANALYSIS OF ALGORITHMS 1 Dr.Nisha Soms/SRIT Semester-06/2020-2021
  • 2. • There are three types of analysis that we perform on a particular algorithm. • Best Case indicates the minimum time required for program execution. • For example, the best case for a sorting algorithm would be data that's already sorted. 2 Dr.Nisha Soms/SRIT
  • 3. • Average Case indicates the average time required for program execution. • Finding average case can be very difficult. • Worst Case indicates the maximum time required for program execution. • For example, the worst case for a sorting algorithm might be data that's sorted in reverse order (but it depends on the particular algorithm). 3 Dr.Nisha Soms/SRIT
  • 5.  The standard notations used to define the time required and the space required by the algorithm.  The word Asymptotic means approaching a value or curve arbitrarily closely (i.e., as some sort of limit is taken).  There are three types of asymptotic notations to represent the growth of any algorithm, as input increases: ▪ Big Theta (Θ) ▪ Big Oh(O) ▪ Big Omega (Ω) 5 Dr.Nisha Soms/SRIT
  • 6. 6 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  f(n) is O(g(n)), if there exists constants c and n0 , s.t. f(n) ≤ c g(n) for all n ≥ n0  f(n) and g(n) are functions over non-negative integers
  • 7. 7 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  The notation Ο(n) is the formal way to express the upper bound of an algorithm's running time.  It measures the worst case time complexity or the longest amount of time an algorithm can possibly take to complete.
  • 8. 8 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  f(n) is Ω(g(n)) if there exists constants c and n0, such that c g(n) ≤ f(n) for n ≥ n 0
  • 9. 9 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  The notation Ω(n) is the formal way to express the lower bound of an algorithm's running time.  It measures the best case time complexity or the best amount of time an algorithm can possibly take to complete.
  • 10. 1 0 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  f(n) is Ɵ(g(n)) if there exists constants c1 , c2 , and n0, such that c1 g(n) ≤ f(n) ≤ c2 g(n) for n ≥ n0
  • 11. 1 1 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  The notation θ(n) is the formal way to express both the lower bound and the upper bound of an algorithm's running time.  It measures the average case time complexity average amount of time an algorithm can possibly take to complete.
  • 12.  Given f(n) and g(n), which grows faster?  If Lim n→∞ f(n)/g(n) = 0, then g(n) is faster  If Lim n→∞ f(n)/g(n) = ∞, then f(n) is faster  If Lim n→∞ f(n)/g(n) = non-zero constant, then both grow at the same rate  Solved Problems are available in https://www.cse.wustl.edu/~sg/CS241_FL99/h w1-practice.html Semester-06/2020-2021 Dr.Nisha Soms/SRIT 12
  • 13. 1 3 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  General Property: If f(n) is O(g(n)) then a*f(n) is also O(g(n)) ; where a is a constant.  Example: f(n) = 2n²+5 is O(n²) then 7*f(n) = 7(2n²+5) = 14n²+35 is also O(n²)  Similarly, this property satisfies both Θ and Ω notation.  We can say  If f(n) is Θ(g(n)) then a*f(n) is also Θ(g(n)); where a is a constant.  If f(n) is Ω (g(n)) then a*f(n) is also Ω (g(n)); where a is a constant.
  • 14. 1 4 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  Reflexive Property: If f(n) is given then f(n) = O(f(n))  Example: If f(n) = n3 ⇒ O(n3)  Similarly,  f(n) = Ω(f(n))  f(n) = Θ(f(n))
  • 15. 1 5 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  Transitive Property: If f(n) is O(g(n)) and g(n) is O(h(n)) then f(n) = O(h(n)) .  Example: if f(n) = n , g(n) = n² and h(n)=n³ n is O(n²) and n² is O(n³) then n is O(n³)  Similarly this property satisfies for both Θ and Ω notation.  We can say  If f(n) is Θ(g(n)) and g(n) is Θ(h(n)) then f(n) = Θ(h(n))  If f(n) is Ω (g(n)) and g(n) is Ω (h(n)) then f(n) = Ω (h(n))
  • 16. 1 6 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  Symmetric Property: If f(n) is Θ(g(n)) then g(n) is Θ(f(n)) .  Example: f(n) = n² and g(n) = n² then f(n) = Θ(n²) and g(n) = Θ(n²) This property only satisfies for Θ notation.
  • 17. 1 7 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  Transpose Symmetric Property: If f(n) is O(g(n)) then g(n) is Ω (f(n)).  Example: f(n) = n , g(n) = n² then n is O(n²) and n² is Ω (n) This property only satisfies for O and Ω notations.
  • 18. 1 8 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  Transpose Symmetric Property: If f(n) is O(g(n)) then g(n) is Ω (f(n)).  Example: f(n) = n , g(n) = n² then n is O(n²) and n² is Ω (n) This property only satisfies for O and Ω notations.
  • 19. 1 9 Semester-06/2020-2021 Dr.Nisha Soms/SRIT  If f(n) = O(g(n)) and f(n) = Ω(g(n)) then f(n) = Θ(g(n))  If f(n) = O(g(n)) and d(n)=O(e(n)) then f(n) + d(n) = O( max( g(n), e(n) ))  Example: f(n) = n i.e O(n), d(n) = n² i.e O(n²) then f(n) + d(n) = n + n² i.e O(n²)  If f(n)=O(g(n)) and d(n)=O(e(n)) then f(n) * d(n) = O( g(n) * e(n) )  Example: f(n) = n i.e O(n), d(n) = n² i.e O(n²) then f(n) * d(n) = n * n² = n³ i.e O(n³)
  • 20.  Solved Problems are available in https://www.cse.wustl.edu/~sg/CS241_FL99/h w1-practice.html Semester-06/2020-2021 Dr.Nisha Soms/SRIT 20
  • 21.  https://dotnettutorials.net/lesson/properties-of- asymptotic-notations/  https://unacademy.com/lesson/properties-of- asymptotic-notation-part-1/1F2FTIU0  https://www.cse.iitd.ac.in/~mausam/courses/col1 06/autumn2017/lectures/02-asymptotic.pdf  https://www.cse.iitd.ac.in/~pkalra/col100/slides/1 0-Efficiency.pdf  https://www.cse.wustl.edu/~sg/CS241_FL99/hw1 -practice.html Semester-06/2020-2021 Dr.Nisha Soms/SRIT 21
  • 22. Please Click Like, Share and Subscribe ! Semester-06/2020-2021 Dr.Nisha Soms/SRIT 22