SlideShare a Scribd company logo
CS8451- DESIGN AND
ANALYSIS OF
ALGORITHMS
Prepared By
Ms.P.Jothi Thilaga, AP/CSE
Ramco Institute of Technology
Rajapalayam
Why we need to study “ALGORITHMS”?
As programs get complicated, thinking algorithmically
allows us to:
• reason about their correctness and efficiency before
implementing them
• focus on techniques for solving problems
• understand relationship between different
computational problems
Algorithms
• The term algorithm originates from the name of the Persian
mathematician “Al Khowarismi”.
• He had presented generic methods for solving certain categories of
problems for the first time in 825 A.D.
• In 300 B.C., the Greek mathematician Euclid design an efficient
algorithm for finding GCD.
• In Computer science, an algorithm is a set of
unambiguous instructions to solve a problem. i.e., for
obtaining a required output for any legitimate input in
a finite amount of time.
• Algorithms are used for calculation, data processing
and automated reasoning.
• An algorithm is an effective method expressed as a
finite list of well-defined instructions for calculating a
function.
Algorithms
NOTION OF ALGORITHM
Properties:
• Non-ambiguity
• Multiplicity
• Range of Inputs
• Definiteness
• Finiteness
Fundamentals of the Analysis of
Algorithm Efficiency
• Issues:
Time efficiency
Space efficiency
correctness
optimality
• Approaches:
theoretical analysis
empirical analysis
Measuring an Input’s size
• Algorithm efficiency is measured in terms of ‘n’
where n is the input size of an algorithm.
• In some cases, more than one parameter is required to
indicate the size of their inputs.
• In this case the size is represented by the ‘n’ bits.
• To measure size by the number b of bits in the n’s
binary representation:
b = floor(log2n)+1
Examples
Time Complexity
• The execution time depends on,
System load
Number of other programs running
Instruction set used
Speed of underlying hardware
Orders of Growth
Units of measuring running time
T(n)=cop C(n)
• T(n) - running time of basic operation.
• cop - time taken by the basic operation to execute.
• C(n) – Number of times the operation needs to be executed.
Example: Sequential Search
• Best Case: 1 comparisons
• Worst Case: ‘n’ key comparisons
• Average Case: (n+1)/2, assume k is in A
Amortized Efficiency
• Amortized complexity is defined as the finding the
average running time or operation over a worst case
sequence of operations.
Empirical Analysis
1. Understand the experiment's purpose.
2. Decide on the efficiency metric M to be measured
and the measurement unit
3. Decide on characteristics of the input sample
4. Prepare a program implementing the algorithm for
the experimentation.
5. Generate a sample of inputs.
6. Run the algorithm on the sample's inputs and record
the data observed.
7. Analyze the data obtained.
THEORETICAL ANALYSIS
• Analyze before program
is written
• Independent of machine
& programming
environment
• Independent of input
instances
• Need mathematical
knowledge
• For lengthy algorithms,
analysis is difficult
EMPIRICALANALYSIS
• Analyze after the program
is written
• Dependent of
programming
Environment
• Depends on input
instances
• Mathematical knowledge
not required
• Length of the program is
immaterial
Thank You

More Related Content

PPT
Complexity Analysis
PPT
Amortized analysis
PPTX
Python algorithm efficency
PPTX
Mathematical Analysis of Non-Recursive Algorithm.
PPTX
Pengenalan Algoritma
PDF
Introduction to Algorithms Complexity Analysis
PPTX
Performance analysis(Time & Space Complexity)
Complexity Analysis
Amortized analysis
Python algorithm efficency
Mathematical Analysis of Non-Recursive Algorithm.
Pengenalan Algoritma
Introduction to Algorithms Complexity Analysis
Performance analysis(Time & Space Complexity)

What's hot (20)

PDF
Lecture 2 role of algorithms in computing
PPTX
Daa unit 1
PPTX
Unit i basic concepts of algorithms
PPT
Analysis of algo
PPTX
Halsted’s Software Science-An analytical technique
PPTX
Algorithm analysis and efficiency
PPTX
Analysis of algorithm
PPTX
Analysis of algorithn class 2
PPT
Algorithm analysis
PDF
Algorithm Analyzing
PPT
chapter 1
PPT
Parallel Algorithms- Sorting and Graph
PPTX
Analysis algorithm
PDF
Algorithms Lecture 1: Introduction to Algorithms
PPTX
Data structures algorithms basics
PPT
Fundamentals of the Analysis of Algorithm Efficiency
PDF
Design & Analysis of Algorithms Lecture Notes
PPTX
Data Structures - Lecture 1 [introduction]
PPT
Model and Design
PDF
Lecture 3 insertion sort and complexity analysis
Lecture 2 role of algorithms in computing
Daa unit 1
Unit i basic concepts of algorithms
Analysis of algo
Halsted’s Software Science-An analytical technique
Algorithm analysis and efficiency
Analysis of algorithm
Analysis of algorithn class 2
Algorithm analysis
Algorithm Analyzing
chapter 1
Parallel Algorithms- Sorting and Graph
Analysis algorithm
Algorithms Lecture 1: Introduction to Algorithms
Data structures algorithms basics
Fundamentals of the Analysis of Algorithm Efficiency
Design & Analysis of Algorithms Lecture Notes
Data Structures - Lecture 1 [introduction]
Model and Design
Lecture 3 insertion sort and complexity analysis
Ad

Similar to Analysis of algorithms (20)

PDF
Performance Analysis,Time complexity, Asymptotic Notations
PPT
introegthnhhdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhppt
PDF
Algorithm Analysis.pdf
PPTX
Design and Analysis of Algorithms.pptx
PPT
Introduction to design and analysis of algorithm
PPT
Chapter1.1 Introduction.ppt
PPT
Chapter1.1 Introduction to design and analysis of algorithm.ppt
PPTX
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
PPTX
Unit 1, ADA.pptx
PDF
Machine Learning All topics Covers In This Single Slides
PPT
Lec1.ppt
PPT
Aad introduction
PDF
CCS 3102 Lecture 3_ Complexity theory.pdf
PPT
Algorithms
PDF
Analysis of Algorithms
PPTX
Chapter 09 design and analysis of algorithms
PPTX
Unit ii algorithm
PDF
01 CS316_Introduction.pdf5959695559655565
PPTX
Algorithm analysis and design
Performance Analysis,Time complexity, Asymptotic Notations
introegthnhhdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhppt
Algorithm Analysis.pdf
Design and Analysis of Algorithms.pptx
Introduction to design and analysis of algorithm
Chapter1.1 Introduction.ppt
Chapter1.1 Introduction to design and analysis of algorithm.ppt
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
Unit 1, ADA.pptx
Machine Learning All topics Covers In This Single Slides
Lec1.ppt
Aad introduction
CCS 3102 Lecture 3_ Complexity theory.pdf
Algorithms
Analysis of Algorithms
Chapter 09 design and analysis of algorithms
Unit ii algorithm
01 CS316_Introduction.pdf5959695559655565
Algorithm analysis and design
Ad

Recently uploaded (20)

PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
UNIT 4 Total Quality Management .pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPT
Mechanical Engineering MATERIALS Selection
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Lecture Notes Electrical Wiring System Components
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
web development for engineering and engineering
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
bas. eng. economics group 4 presentation 1.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
UNIT 4 Total Quality Management .pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
additive manufacturing of ss316l using mig welding
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Mechanical Engineering MATERIALS Selection
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Model Code of Practice - Construction Work - 21102022 .pdf
Lecture Notes Electrical Wiring System Components
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
CH1 Production IntroductoryConcepts.pptx
Foundation to blockchain - A guide to Blockchain Tech
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
web development for engineering and engineering
Operating System & Kernel Study Guide-1 - converted.pdf

Analysis of algorithms

  • 1. CS8451- DESIGN AND ANALYSIS OF ALGORITHMS Prepared By Ms.P.Jothi Thilaga, AP/CSE Ramco Institute of Technology Rajapalayam
  • 2. Why we need to study “ALGORITHMS”? As programs get complicated, thinking algorithmically allows us to: • reason about their correctness and efficiency before implementing them • focus on techniques for solving problems • understand relationship between different computational problems
  • 3. Algorithms • The term algorithm originates from the name of the Persian mathematician “Al Khowarismi”. • He had presented generic methods for solving certain categories of problems for the first time in 825 A.D. • In 300 B.C., the Greek mathematician Euclid design an efficient algorithm for finding GCD.
  • 4. • In Computer science, an algorithm is a set of unambiguous instructions to solve a problem. i.e., for obtaining a required output for any legitimate input in a finite amount of time. • Algorithms are used for calculation, data processing and automated reasoning. • An algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function.
  • 6. NOTION OF ALGORITHM Properties: • Non-ambiguity • Multiplicity • Range of Inputs • Definiteness • Finiteness
  • 7. Fundamentals of the Analysis of Algorithm Efficiency • Issues: Time efficiency Space efficiency correctness optimality • Approaches: theoretical analysis empirical analysis
  • 8. Measuring an Input’s size • Algorithm efficiency is measured in terms of ‘n’ where n is the input size of an algorithm. • In some cases, more than one parameter is required to indicate the size of their inputs. • In this case the size is represented by the ‘n’ bits. • To measure size by the number b of bits in the n’s binary representation: b = floor(log2n)+1
  • 10. Time Complexity • The execution time depends on, System load Number of other programs running Instruction set used Speed of underlying hardware
  • 12. Units of measuring running time T(n)=cop C(n) • T(n) - running time of basic operation. • cop - time taken by the basic operation to execute. • C(n) – Number of times the operation needs to be executed.
  • 13. Example: Sequential Search • Best Case: 1 comparisons • Worst Case: ‘n’ key comparisons • Average Case: (n+1)/2, assume k is in A
  • 14. Amortized Efficiency • Amortized complexity is defined as the finding the average running time or operation over a worst case sequence of operations.
  • 15. Empirical Analysis 1. Understand the experiment's purpose. 2. Decide on the efficiency metric M to be measured and the measurement unit 3. Decide on characteristics of the input sample 4. Prepare a program implementing the algorithm for the experimentation. 5. Generate a sample of inputs. 6. Run the algorithm on the sample's inputs and record the data observed. 7. Analyze the data obtained.
  • 16. THEORETICAL ANALYSIS • Analyze before program is written • Independent of machine & programming environment • Independent of input instances • Need mathematical knowledge • For lengthy algorithms, analysis is difficult EMPIRICALANALYSIS • Analyze after the program is written • Dependent of programming Environment • Depends on input instances • Mathematical knowledge not required • Length of the program is immaterial