SlideShare a Scribd company logo
8
Most read
11
Most read
18
Most read
Chapter 2Chapter 2
Complexity analysisComplexity analysis
01/29/18 BY MS. SHAISTA QADIR 1
PRESENTED BY
Shaista Qadir
Lecturer king khalid university
ContentsContents
 algorithm and its properties
 Computational Complexity
 time Complexity
 spaCe Complexity
 Complexity analysis and asymptotiC
notations.
 Big-oh-notation (o)
 omega-notation ( )Ω
 theta-notation ( )Θ
 the Best, average, and Worst Case analyses.
 Complexity analyses examples.
 Comparing groWth rates
01/29/18 BY MS. SHAISTA QADIR 2
algorithm and itsalgorithm and its
propertiesproperties
01/29/18 BY MS. SHAISTA QADIR 3
 An algorithm is a step by step procedure for calculating a
function.
 An algorithm can exist for a day to day task, a simple
program or a complex calculation.
 To write an algorithm for a problem one should know
◦ The input to be supplied for the program.
◦ The operation to be performed on the input to perform the
task.
◦ The output to be obtained.
◦ Any assumptions or initializations to be made for solving
the problem.
algorithm and itsalgorithm and its
propertiesproperties
01/29/18 BY MS. SHAISTA QADIR 4
 An algorithm for a problem has the following properties:
 Finiteness: An algorithm should have a finite number of steps
and should terminate after these finite number of steps.
 Definiteness: Every step in the algorithm should be very clear.
The steps shall be explained in only one way and executed
without any confusion.
 Effectiveness: The instructions of the algorithm are realizable.
The steps in the algorithm shall be executed in finite amount of
time.
 Input: An algorithm can accept no input or it can accept one to
many inputs.
 Output: The algorithm should produce a minimum of one
output.
Computational ComplexityComputational Complexity
01/29/18 BY MS. SHAISTA QADIR 5
 The same problem can frequently be solved with
algorithms that differ in efficiency.
 To compare the efficiency of algorithms, a measure of
the degree of difficulty of an algorithm called
computational complexity was developed by Juris
Hartmanis and Richard E.Stearns.
 Computational complexity indicates how much effort is
needed to apply an algorithm or how costly it is.
 Computational Complexity is measured in terms of two
efficiencies to design good algorithms.
◦ Space efficiency
◦ Time efficiency
Computational ComplexityComputational Complexity
(( SpaCe effiCienCySpaCe effiCienCy ))
01/29/18 BY MS. SHAISTA QADIR 6
 These efficiency measures helps us to understand which
algorithm is better than other.
 Space Efficiency:
◦ Space Efficiency is on how efficiently the algorithm
consumes memory space.
◦ Space required will depend upon
 program size (constant)
 data size (constant and dynamic)
◦ These days machines come with large memory sizes to
solve this problem.
Computational ComplexityComputational Complexity
( SpaCe effiCienCy )( SpaCe effiCienCy )
01/29/18 BY MS. SHAISTA QADIR 7
 Two space Components
◦ Fixed static part (Cp): space for numbers, constants,
size of input, output and program .
◦ Variable dynamic part (Sp): space for variables whose
size is problem dependent and dynamic.
 Total space requirement for an algorithm is the sum of
fixed and dynamic part.
◦ S(P)= Cp+Sp
Computational ComplexityComputational Complexity
( illuStration )( illuStration )
01/29/18 BY MS. SHAISTA QADIR 8
 Illustration: Find the total space requirement for the
following pieces of codes (neglect program space
requirement)
◦ i) code to find difference between two numbers.
int x,y,dif;
dif = x-y;
 Here there are three static variables x, y, dif and no
dynamic variables. Space allotted for int variable is 4
bytes.
 Therefore, S(P)= Cp+Sp
 S(P)= 3x4+0 =12 bytes
Computational ComplexityComputational Complexity
( illuStration )( illuStration )
01/29/18 BY MS. SHAISTA QADIR 9
◦ ii) code to add numbers of array.
int add(int x[], int n)
{ int total = 0, i;
for(i=0; i<n; i++)
total = total + x[i];
return total; }
 Here there are three static variables, int n, total, i and one
dynamic variable int x which depends upon the value n.
 Space allotted for int variable is 4 bytes.
◦ Therefore, S(P)= Cp+Sp
◦ S(P)= (3x4)+(nx4)
◦ S(P) =12 + (nx4) bytes
Computational ComplexityComputational Complexity
( time effiCenCy )( time effiCenCy )
01/29/18 BY MS. SHAISTA QADIR 10
 Time Efficiency
◦ is determined based on the amount of time required to run
a program.
◦ It depends upon the number of instructions to be executed
which in turn is dependent on the amount of data. It is
hardware independent.
 Time Efficiency/ Time Complexity analysis is essential to know
◦ If the algorithm is “fast enough” for my needs
◦ How longer will the algorithm take if I increase the amount
of data it must process?
◦ Which is the right algorithm, among the given a set of
algorithms that accomplish the same thing.
Computational ComplexityComputational Complexity
( illustration )( illustration )
01/29/18 BY MS. SHAISTA QADIR 11
 Consider the piece of code
for (int i=1; i<= n ; i++)
for int j=1 ; j <= n; j++)
{
cout << i; 1
p = p + i; 1 2n (2n)n
}
 The 1st loop runs n times, 2nd loop runs n times, the
third and fourth statements run 1 unit each.
 So the total run-time is equal to 2n2
Complexity analysis andComplexity analysis and
asymptotiC notationsasymptotiC notations
01/29/18 BY MS. SHAISTA QADIR 12
 To analyze the computational complexity of algorithms
in terms of time, computer scientists used several
asymptotic notations and important notations among
them are:
 Big-oh-notation (O)
 Omega-notation (Ω)
 Theta-notation (Θ)
 Asymptotic Notations provides a formula that associates
n, the problem size, with t, the processing time required
to solve the problem.
Complexity analysis and asymptotiCComplexity analysis and asymptotiC
notationsnotations
(Worst Case analyses )(Worst Case analyses )
01/29/18 BY MS. SHAISTA QADIR 13
 Big-oh-notation (O)
Big-O, “bounded above by”
 Let T(n) be a measure of the time required to execute an
algorithm of problem size n.
 then for some positive values of constants c and N, the
Big-Oh (O) of a function f(n) on n is given by
T(n)=O(f(n))
T(n)<=c(f(n)) where n>N
 It gives the maximum value of T(n) or the WORST case
for any possible input.
Complexity analysis and asymptotiCComplexity analysis and asymptotiC
notationsnotations
( Best( Best Case analysis )Case analysis )
01/29/18 BY MS. SHAISTA QADIR 14
 Omega-notation (Ω)
Omega, “bounded below by”
 Let T(n) be a measure of the time required to execute an
algorithm of problem size n.
 then for some positive values of constants c and N, the
Omega (Ω) of a function f(n) on n is given by
T(n)= Ω(f(n))
T(n)>=c(f(n)) where n>N
 It gives the minimum value of T(n) or the BEST case for
any possible input.
Complexity analysis and asymptotiCComplexity analysis and asymptotiC
notationsnotations
( aVeraGe Case analysis )( aVeraGe Case analysis )
01/29/18 BY MS. SHAISTA QADIR 15
 Theta-notation (Θ)
Theta, “bounded above and below”
 Let T(n) be a measure of the time required to execute an
algorithm of problem size n.
 then for some positive values of constants c1, c2 and N,
the Theta (Θ) of a function f(n) on n is given by
T(n)= Θ(f(n))
c (f(n)) <=T(n)<= c1(c2(f(n)) where n>N
 It gives the expected value of T(n) or the AVERAGE case
for any possible input.
Complexity AnAlysis .Complexity AnAlysis .
01/29/18 BY MS. SHAISTA QADIR 16
 Big O or the Order of n measurement or the Worst Case
 is used mostly in the estimation of performance of a
piece of code against the amount of data.
 For the piece of code,
for (int i=1; i<= n ; i++)
for int j=1 ; j <= n; j++)
{ cout << i;
p = p + i;
} T(n)=2n2
Complexity AnAlysisComplexity AnAlysis
( exAmple )( exAmple )
01/29/18 BY MS. SHAISTA QADIR 17
 To find Big O from T(n)= 2n2
1. Discarding constant terms produces :
Here no constants 2n2
2. Clearing coefficients : n2
3. Picking the most significant term: n2
T(n)=O(n2 )
Complexity AnAlysisComplexity AnAlysis
( exAmple s)( exAmple s)
01/29/18 BY MS. SHAISTA QADIR 18
 Example:1
Time =2n3
+2n+100
Step:1 Discarding constant terms produces: 2n3
+2n
Step: 2 Clearing coefficients : n3
+n
Step: 3 Picking the most significant term: n3
Time = O(n3
)
 Example:2
Time =3n3
+150
Step:1 Discarding constant terms produces: 3n3
Step: 2 Clearing coefficients : n3
Step: 3 Picking the most significant term: n3
Time =O(n3
)
CompAring groWtH rAtesCompAring groWtH rAtes
01/29/18 BY MS. SHAISTA QADIR 19
01/29/18 BY MS. SHAISTA QADIR 20
THANK YOUTHANK YOU

More Related Content

PPTX
Design and Analysis of Algorithms.pptx
PPTX
Matrix chain multiplication
PPTX
Huffman's algorithm in Data Structure
PPT
Design and Analysis of Algorithms
PDF
Introduction to algorithms
PPT
SINGLE-SOURCE SHORTEST PATHS
PPT
pushdown automata
PPT
Dinive conquer algorithm
Design and Analysis of Algorithms.pptx
Matrix chain multiplication
Huffman's algorithm in Data Structure
Design and Analysis of Algorithms
Introduction to algorithms
SINGLE-SOURCE SHORTEST PATHS
pushdown automata
Dinive conquer algorithm

What's hot (20)

PPTX
Syntax Analysis in Compiler Design
PPTX
Merge sort and quick sort
PPT
Unit 1 chapter 1 Design and Analysis of Algorithms
PPTX
Data Structures : hashing (1)
PPTX
Two-way Deterministic Finite Automata
PPTX
Asymptotic Notations
PPT
5.1 greedy
PPTX
Strassen's matrix multiplication
PDF
Algorithms Lecture 2: Analysis of Algorithms I
PDF
Principles of programming languages. Detail notes
PPTX
Hashing Technique In Data Structures
PPTX
SHA- Secure hashing algorithm
PPTX
Multidimensional schema of data warehouse
PPTX
Data Structure and Algorithms.pptx
PPTX
Lecture optimal binary search tree
PPT
PPT
Chapter18
PPTX
Analysis of algorithm
PPTX
Structure of the compiler
PPTX
CONTEXT FREE GRAMMAR
Syntax Analysis in Compiler Design
Merge sort and quick sort
Unit 1 chapter 1 Design and Analysis of Algorithms
Data Structures : hashing (1)
Two-way Deterministic Finite Automata
Asymptotic Notations
5.1 greedy
Strassen's matrix multiplication
Algorithms Lecture 2: Analysis of Algorithms I
Principles of programming languages. Detail notes
Hashing Technique In Data Structures
SHA- Secure hashing algorithm
Multidimensional schema of data warehouse
Data Structure and Algorithms.pptx
Lecture optimal binary search tree
Chapter18
Analysis of algorithm
Structure of the compiler
CONTEXT FREE GRAMMAR
Ad

Similar to Complexity Analysis (20)

PDF
lecture2-180129175419 (1).pdfhhhhhhhhhhh
PPTX
Presentation_23953_Content_Document_20240906040454PM.pptx
PDF
Algorithm Analysis.pdf
PPTX
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
PPT
Big Oh.ppt
PPT
Analysis of Algorithum
PDF
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
PDF
Design Analysis and Algorithm Module1.pdf
PPT
Lec7.ppt
PPT
Lec7.ppt
PPT
analysis of algorithms
PPT
Introduction to Algorithms
PPTX
Asymptotic Analysis in Data Structure using C
PPT
Analysis of the time complexity of data structures.ppt
PPTX
BCSE202Lkkljkljkbbbnbnghghjghghghghghghghgh
PPT
daa_unit THIS IS GNDFJG SDGSGS SFDF .ppt
PPTX
DESIGN AND ALGORITHM.pptx BCA BANGALORECITY UNIVERSITY
PPTX
design analysis of algorithmaa unit 1.pptx
PPT
data unit notes from department of computer science
lecture2-180129175419 (1).pdfhhhhhhhhhhh
Presentation_23953_Content_Document_20240906040454PM.pptx
Algorithm Analysis.pdf
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
Big Oh.ppt
Analysis of Algorithum
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Design Analysis and Algorithm Module1.pdf
Lec7.ppt
Lec7.ppt
analysis of algorithms
Introduction to Algorithms
Asymptotic Analysis in Data Structure using C
Analysis of the time complexity of data structures.ppt
BCSE202Lkkljkljkbbbnbnghghjghghghghghghghgh
daa_unit THIS IS GNDFJG SDGSGS SFDF .ppt
DESIGN AND ALGORITHM.pptx BCA BANGALORECITY UNIVERSITY
design analysis of algorithmaa unit 1.pptx
data unit notes from department of computer science
Ad

More from Shaista Qadir (8)

PDF
Chapter - 2 introduction to Computer Organization.pdf
PDF
Chapter - 1 Introduction to Computer Science.pdf
PPT
Lecture 4
PPSX
Lecture 1
PPT
Sorting
PPT
Searching
PPT
PPT
linked list
Chapter - 2 introduction to Computer Organization.pdf
Chapter - 1 Introduction to Computer Science.pdf
Lecture 4
Lecture 1
Sorting
Searching
linked list

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
KodekX | Application Modernization Development
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Programs and apps: productivity, graphics, security and other tools
Understanding_Digital_Forensics_Presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
KodekX | Application Modernization Development
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectral efficient network and resource selection model in 5G networks
Building Integrated photovoltaic BIPV_UPV.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx

Complexity Analysis

  • 1. Chapter 2Chapter 2 Complexity analysisComplexity analysis 01/29/18 BY MS. SHAISTA QADIR 1 PRESENTED BY Shaista Qadir Lecturer king khalid university
  • 2. ContentsContents  algorithm and its properties  Computational Complexity  time Complexity  spaCe Complexity  Complexity analysis and asymptotiC notations.  Big-oh-notation (o)  omega-notation ( )Ω  theta-notation ( )Θ  the Best, average, and Worst Case analyses.  Complexity analyses examples.  Comparing groWth rates 01/29/18 BY MS. SHAISTA QADIR 2
  • 3. algorithm and itsalgorithm and its propertiesproperties 01/29/18 BY MS. SHAISTA QADIR 3  An algorithm is a step by step procedure for calculating a function.  An algorithm can exist for a day to day task, a simple program or a complex calculation.  To write an algorithm for a problem one should know ◦ The input to be supplied for the program. ◦ The operation to be performed on the input to perform the task. ◦ The output to be obtained. ◦ Any assumptions or initializations to be made for solving the problem.
  • 4. algorithm and itsalgorithm and its propertiesproperties 01/29/18 BY MS. SHAISTA QADIR 4  An algorithm for a problem has the following properties:  Finiteness: An algorithm should have a finite number of steps and should terminate after these finite number of steps.  Definiteness: Every step in the algorithm should be very clear. The steps shall be explained in only one way and executed without any confusion.  Effectiveness: The instructions of the algorithm are realizable. The steps in the algorithm shall be executed in finite amount of time.  Input: An algorithm can accept no input or it can accept one to many inputs.  Output: The algorithm should produce a minimum of one output.
  • 5. Computational ComplexityComputational Complexity 01/29/18 BY MS. SHAISTA QADIR 5  The same problem can frequently be solved with algorithms that differ in efficiency.  To compare the efficiency of algorithms, a measure of the degree of difficulty of an algorithm called computational complexity was developed by Juris Hartmanis and Richard E.Stearns.  Computational complexity indicates how much effort is needed to apply an algorithm or how costly it is.  Computational Complexity is measured in terms of two efficiencies to design good algorithms. ◦ Space efficiency ◦ Time efficiency
  • 6. Computational ComplexityComputational Complexity (( SpaCe effiCienCySpaCe effiCienCy )) 01/29/18 BY MS. SHAISTA QADIR 6  These efficiency measures helps us to understand which algorithm is better than other.  Space Efficiency: ◦ Space Efficiency is on how efficiently the algorithm consumes memory space. ◦ Space required will depend upon  program size (constant)  data size (constant and dynamic) ◦ These days machines come with large memory sizes to solve this problem.
  • 7. Computational ComplexityComputational Complexity ( SpaCe effiCienCy )( SpaCe effiCienCy ) 01/29/18 BY MS. SHAISTA QADIR 7  Two space Components ◦ Fixed static part (Cp): space for numbers, constants, size of input, output and program . ◦ Variable dynamic part (Sp): space for variables whose size is problem dependent and dynamic.  Total space requirement for an algorithm is the sum of fixed and dynamic part. ◦ S(P)= Cp+Sp
  • 8. Computational ComplexityComputational Complexity ( illuStration )( illuStration ) 01/29/18 BY MS. SHAISTA QADIR 8  Illustration: Find the total space requirement for the following pieces of codes (neglect program space requirement) ◦ i) code to find difference between two numbers. int x,y,dif; dif = x-y;  Here there are three static variables x, y, dif and no dynamic variables. Space allotted for int variable is 4 bytes.  Therefore, S(P)= Cp+Sp  S(P)= 3x4+0 =12 bytes
  • 9. Computational ComplexityComputational Complexity ( illuStration )( illuStration ) 01/29/18 BY MS. SHAISTA QADIR 9 ◦ ii) code to add numbers of array. int add(int x[], int n) { int total = 0, i; for(i=0; i<n; i++) total = total + x[i]; return total; }  Here there are three static variables, int n, total, i and one dynamic variable int x which depends upon the value n.  Space allotted for int variable is 4 bytes. ◦ Therefore, S(P)= Cp+Sp ◦ S(P)= (3x4)+(nx4) ◦ S(P) =12 + (nx4) bytes
  • 10. Computational ComplexityComputational Complexity ( time effiCenCy )( time effiCenCy ) 01/29/18 BY MS. SHAISTA QADIR 10  Time Efficiency ◦ is determined based on the amount of time required to run a program. ◦ It depends upon the number of instructions to be executed which in turn is dependent on the amount of data. It is hardware independent.  Time Efficiency/ Time Complexity analysis is essential to know ◦ If the algorithm is “fast enough” for my needs ◦ How longer will the algorithm take if I increase the amount of data it must process? ◦ Which is the right algorithm, among the given a set of algorithms that accomplish the same thing.
  • 11. Computational ComplexityComputational Complexity ( illustration )( illustration ) 01/29/18 BY MS. SHAISTA QADIR 11  Consider the piece of code for (int i=1; i<= n ; i++) for int j=1 ; j <= n; j++) { cout << i; 1 p = p + i; 1 2n (2n)n }  The 1st loop runs n times, 2nd loop runs n times, the third and fourth statements run 1 unit each.  So the total run-time is equal to 2n2
  • 12. Complexity analysis andComplexity analysis and asymptotiC notationsasymptotiC notations 01/29/18 BY MS. SHAISTA QADIR 12  To analyze the computational complexity of algorithms in terms of time, computer scientists used several asymptotic notations and important notations among them are:  Big-oh-notation (O)  Omega-notation (Ω)  Theta-notation (Θ)  Asymptotic Notations provides a formula that associates n, the problem size, with t, the processing time required to solve the problem.
  • 13. Complexity analysis and asymptotiCComplexity analysis and asymptotiC notationsnotations (Worst Case analyses )(Worst Case analyses ) 01/29/18 BY MS. SHAISTA QADIR 13  Big-oh-notation (O) Big-O, “bounded above by”  Let T(n) be a measure of the time required to execute an algorithm of problem size n.  then for some positive values of constants c and N, the Big-Oh (O) of a function f(n) on n is given by T(n)=O(f(n)) T(n)<=c(f(n)) where n>N  It gives the maximum value of T(n) or the WORST case for any possible input.
  • 14. Complexity analysis and asymptotiCComplexity analysis and asymptotiC notationsnotations ( Best( Best Case analysis )Case analysis ) 01/29/18 BY MS. SHAISTA QADIR 14  Omega-notation (Ω) Omega, “bounded below by”  Let T(n) be a measure of the time required to execute an algorithm of problem size n.  then for some positive values of constants c and N, the Omega (Ω) of a function f(n) on n is given by T(n)= Ω(f(n)) T(n)>=c(f(n)) where n>N  It gives the minimum value of T(n) or the BEST case for any possible input.
  • 15. Complexity analysis and asymptotiCComplexity analysis and asymptotiC notationsnotations ( aVeraGe Case analysis )( aVeraGe Case analysis ) 01/29/18 BY MS. SHAISTA QADIR 15  Theta-notation (Θ) Theta, “bounded above and below”  Let T(n) be a measure of the time required to execute an algorithm of problem size n.  then for some positive values of constants c1, c2 and N, the Theta (Θ) of a function f(n) on n is given by T(n)= Θ(f(n)) c (f(n)) <=T(n)<= c1(c2(f(n)) where n>N  It gives the expected value of T(n) or the AVERAGE case for any possible input.
  • 16. Complexity AnAlysis .Complexity AnAlysis . 01/29/18 BY MS. SHAISTA QADIR 16  Big O or the Order of n measurement or the Worst Case  is used mostly in the estimation of performance of a piece of code against the amount of data.  For the piece of code, for (int i=1; i<= n ; i++) for int j=1 ; j <= n; j++) { cout << i; p = p + i; } T(n)=2n2
  • 17. Complexity AnAlysisComplexity AnAlysis ( exAmple )( exAmple ) 01/29/18 BY MS. SHAISTA QADIR 17  To find Big O from T(n)= 2n2 1. Discarding constant terms produces : Here no constants 2n2 2. Clearing coefficients : n2 3. Picking the most significant term: n2 T(n)=O(n2 )
  • 18. Complexity AnAlysisComplexity AnAlysis ( exAmple s)( exAmple s) 01/29/18 BY MS. SHAISTA QADIR 18  Example:1 Time =2n3 +2n+100 Step:1 Discarding constant terms produces: 2n3 +2n Step: 2 Clearing coefficients : n3 +n Step: 3 Picking the most significant term: n3 Time = O(n3 )  Example:2 Time =3n3 +150 Step:1 Discarding constant terms produces: 3n3 Step: 2 Clearing coefficients : n3 Step: 3 Picking the most significant term: n3 Time =O(n3 )
  • 19. CompAring groWtH rAtesCompAring groWtH rAtes 01/29/18 BY MS. SHAISTA QADIR 19
  • 20. 01/29/18 BY MS. SHAISTA QADIR 20 THANK YOUTHANK YOU