SlideShare a Scribd company logo
ALGORITHM ANALYSIS
(
1
OUTLINE
 Algorithm Analysis
 Why do we Need Algorithm Analysis?
 What Does A Better Algorithm Mean?
 Asymptotic Analysis
 Big ‘O’ Notation
2
2
INTRODUCTION
 Algorithm analysis is the study to provide theoretical
estimations for the required resources of an algorithm
to solve a specific computational problem i.e.
calculating efficiency.
 Generally the efficiency of an algorithm is related to
the input length that is the number of steps also
known as time complexity or volume of memory
known as space complexity.
3
WHY DO WE NEED ALGORITHM ANALYSIS
 Knowing the efficiency of an algorithm is
vital on a mission critical task.
 Generally there are multiple approaches or
multiple methods to solve one problem
statement so algorithm. Analysis is performed
to figure out which is a better or optimum
approach out of the different options.
WHAT DOES A BETTER ALGORITHM MEAN?
Faster ? (Less execution time) – Time Complexity
Less Memory ? – Space Complexity
Easy to read ?
Less Line of Code?
Less HW/SW needs?
NOTE: algorithm analysis does not give you accurate or
exact values however it gives us estimate which can be
used to study the behavior of the algorithm
ASYMPTOTIC ANALYSIS
Definition: Asymptotic analysis of an algorithm is a method of defining the
mathematical boundaries of its runtime performance.
Simple words: it is used to mathematically calculate the running time of any
operation inside an algorithm
 Asymptotic algorithm analysis used to estimate the time complexity function
for arbitrarily large input.
 Using the asymptotic analysis we can easily estimate about the average case
best case and worst case scenarios of an algorithm.
 Time complexity is a computational way to show how the runtime of a
program increases as the size of the input increases.
Problem Statement:
Write an algorithm or program to find the sum of N numbers(0-N)
Algorithm 1
function sumOfNumbers(N)
{
sum = 0
for(i = 0 to N)
{
sum = sum + i
}
print(sum)
{
8
Problem Statement:
Write an algorithm or program to find the sum of N numbers(0-N)
Algorithm 2
function
sumOfNumbers(N)
{
sum = (N*(N+1))/2
print(sum)
{
Problem Statement:
Write an algorithm or program to find the sum of N numbers(0-N)
BIG ‘O’ NOTATION
 Big O notation is the formal or mathematical way to
express the upper bound or the worst case scenario of an
algorithm’s running time.
 It measures the worst case time complexity or the largest
amount of time an algorithm can possibly take to
complete.
 Following is the list of some common asymptotic
notations –
10
BIG ‘O’ NOTATION
1
1
CONCLUSION
Understanding Algorithm Analysis and
Asymptotic Algorithm Analysis.
Understanding of Big O Notation, its Importance
and significance.
1
2
13
14
Ad

More Related Content

Similar to Algo analysis for computational programmingpptx (20)

algorithmanalysisinfundamentalsofdatastructure-190810085243.pptx
algorithmanalysisinfundamentalsofdatastructure-190810085243.pptxalgorithmanalysisinfundamentalsofdatastructure-190810085243.pptx
algorithmanalysisinfundamentalsofdatastructure-190810085243.pptx
ShirishaBuduputi
 
Design Analysis and Algorithm Module1.pdf
Design Analysis and Algorithm Module1.pdfDesign Analysis and Algorithm Module1.pdf
Design Analysis and Algorithm Module1.pdf
Shana799280
 
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
 
Unit ii algorithm
Unit   ii algorithmUnit   ii algorithm
Unit ii algorithm
Tribhuvan University
 
Unit i basic concepts of algorithms
Unit i basic concepts of algorithmsUnit i basic concepts of algorithms
Unit i basic concepts of algorithms
sangeetha s
 
Aad introduction
Aad introductionAad introduction
Aad introduction
Mr SMAK
 
chapter 1
chapter 1chapter 1
chapter 1
yatheesha
 
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
TechVision8
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
Koteswari Kasireddy
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
Koteswari Kasireddy
 
Analysis algorithm
Analysis algorithmAnalysis algorithm
Analysis algorithm
renukarenuka9
 
DA lecture 3.pptx
DA lecture 3.pptxDA lecture 3.pptx
DA lecture 3.pptx
SayanSen36
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
NayanChandak1
 
Fundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm EfficiencyFundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm Efficiency
Saranya Natarajan
 
Algorithm analysis in fundamentals of data structure
Algorithm analysis in fundamentals of data structureAlgorithm analysis in fundamentals of data structure
Algorithm analysis in fundamentals of data structure
Vrushali Dhanokar
 
Theory of algorithms final
Theory of algorithms final Theory of algorithms final
Theory of algorithms final
Dgech
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
Mallikarjun Biradar
 
IntroductionToAlgo_v1_1709293290768 (2).pptx
IntroductionToAlgo_v1_1709293290768 (2).pptxIntroductionToAlgo_v1_1709293290768 (2).pptx
IntroductionToAlgo_v1_1709293290768 (2).pptx
prasanna220904
 
9 big o-notation
9 big o-notation9 big o-notation
9 big o-notation
irdginfo
 
Design and analysis of algorithms Module-I.pptx
Design and analysis of algorithms Module-I.pptxDesign and analysis of algorithms Module-I.pptx
Design and analysis of algorithms Module-I.pptx
DhanushreeAN1
 
algorithmanalysisinfundamentalsofdatastructure-190810085243.pptx
algorithmanalysisinfundamentalsofdatastructure-190810085243.pptxalgorithmanalysisinfundamentalsofdatastructure-190810085243.pptx
algorithmanalysisinfundamentalsofdatastructure-190810085243.pptx
ShirishaBuduputi
 
Design Analysis and Algorithm Module1.pdf
Design Analysis and Algorithm Module1.pdfDesign Analysis and Algorithm Module1.pdf
Design Analysis and Algorithm Module1.pdf
Shana799280
 
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
 
Unit i basic concepts of algorithms
Unit i basic concepts of algorithmsUnit i basic concepts of algorithms
Unit i basic concepts of algorithms
sangeetha s
 
Aad introduction
Aad introductionAad introduction
Aad introduction
Mr SMAK
 
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
TechVision8
 
DA lecture 3.pptx
DA lecture 3.pptxDA lecture 3.pptx
DA lecture 3.pptx
SayanSen36
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
NayanChandak1
 
Fundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm EfficiencyFundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm Efficiency
Saranya Natarajan
 
Algorithm analysis in fundamentals of data structure
Algorithm analysis in fundamentals of data structureAlgorithm analysis in fundamentals of data structure
Algorithm analysis in fundamentals of data structure
Vrushali Dhanokar
 
Theory of algorithms final
Theory of algorithms final Theory of algorithms final
Theory of algorithms final
Dgech
 
IntroductionToAlgo_v1_1709293290768 (2).pptx
IntroductionToAlgo_v1_1709293290768 (2).pptxIntroductionToAlgo_v1_1709293290768 (2).pptx
IntroductionToAlgo_v1_1709293290768 (2).pptx
prasanna220904
 
9 big o-notation
9 big o-notation9 big o-notation
9 big o-notation
irdginfo
 
Design and analysis of algorithms Module-I.pptx
Design and analysis of algorithms Module-I.pptxDesign and analysis of algorithms Module-I.pptx
Design and analysis of algorithms Module-I.pptx
DhanushreeAN1
 

Recently uploaded (20)

sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Personal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.pptPersonal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.ppt
ganjangbegu579
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation RateModeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Journal of Soft Computing in Civil Engineering
 
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic AlgorithmDesign Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Journal of Soft Computing in Civil Engineering
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Personal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.pptPersonal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.ppt
ganjangbegu579
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Ad

Algo analysis for computational programmingpptx

  • 2. OUTLINE  Algorithm Analysis  Why do we Need Algorithm Analysis?  What Does A Better Algorithm Mean?  Asymptotic Analysis  Big ‘O’ Notation 2 2
  • 3. INTRODUCTION  Algorithm analysis is the study to provide theoretical estimations for the required resources of an algorithm to solve a specific computational problem i.e. calculating efficiency.  Generally the efficiency of an algorithm is related to the input length that is the number of steps also known as time complexity or volume of memory known as space complexity. 3
  • 4. WHY DO WE NEED ALGORITHM ANALYSIS  Knowing the efficiency of an algorithm is vital on a mission critical task.  Generally there are multiple approaches or multiple methods to solve one problem statement so algorithm. Analysis is performed to figure out which is a better or optimum approach out of the different options.
  • 5. WHAT DOES A BETTER ALGORITHM MEAN? Faster ? (Less execution time) – Time Complexity Less Memory ? – Space Complexity Easy to read ? Less Line of Code? Less HW/SW needs? NOTE: algorithm analysis does not give you accurate or exact values however it gives us estimate which can be used to study the behavior of the algorithm
  • 6. ASYMPTOTIC ANALYSIS Definition: Asymptotic analysis of an algorithm is a method of defining the mathematical boundaries of its runtime performance. Simple words: it is used to mathematically calculate the running time of any operation inside an algorithm  Asymptotic algorithm analysis used to estimate the time complexity function for arbitrarily large input.  Using the asymptotic analysis we can easily estimate about the average case best case and worst case scenarios of an algorithm.  Time complexity is a computational way to show how the runtime of a program increases as the size of the input increases.
  • 7. Problem Statement: Write an algorithm or program to find the sum of N numbers(0-N) Algorithm 1 function sumOfNumbers(N) { sum = 0 for(i = 0 to N) { sum = sum + i } print(sum) {
  • 8. 8 Problem Statement: Write an algorithm or program to find the sum of N numbers(0-N)
  • 9. Algorithm 2 function sumOfNumbers(N) { sum = (N*(N+1))/2 print(sum) { Problem Statement: Write an algorithm or program to find the sum of N numbers(0-N)
  • 10. BIG ‘O’ NOTATION  Big O notation is the formal or mathematical way to express the upper bound or the worst case scenario of an algorithm’s running time.  It measures the worst case time complexity or the largest amount of time an algorithm can possibly take to complete.  Following is the list of some common asymptotic notations – 10
  • 12. CONCLUSION Understanding Algorithm Analysis and Asymptotic Algorithm Analysis. Understanding of Big O Notation, its Importance and significance. 1 2
  • 13. 13
  • 14. 14
  翻译: