SlideShare a Scribd company logo
12
Most read
17
Most read
22
Most read
The Design and
Analysis of
Algorithms
by Anany Levitin
2
CHAPTER 1: INTRODUCTIONCHAPTER 1: INTRODUCTION
 What is an Algorithm
 Steps in Designing and Implementing
an Algorithm
 Important Problem Types
 Fundamental Data Structures
3
ALGORITHM
 A sequence of unambiguous
instructions for solving a problem,
i.e. for obtaining the required
output for any legitimate input in
a finite amount of time
Notation of the Algorithm
4
5
Special Features of Algorithms
 Non-ambiguity
 Range of inputs
 The same algorithm can be represented
in different ways
 Several algorithms for solving the
same problem
 Different algorithms with different
speeds
Find the GCD(m,n)
Method 1: Descriptive Algorithm
6
GCD using Euclid’s Method
gcd(m,n)=gcd(n,m nod n)
Find:
1. GCD(124,12)
2. GCD(160,15)
3. GCD(338,22)
4. GCD(150,8)
7
Find the GCD(m,n)
Method 2:
Descriptive Algorithm
8
Find the GCD(m,n)
Method 2: Pseudocode Representation
9
Find the set of all Prime
numbers
Method 1: Middle School Level
Find Set of ALL Prime Numbers within 25
10
Find the set of all Prime
numbers
Method 2: Sieve of Erathosthenes
Find Set of ALL Prime Numbers within 25
11
Fundamentals of Algorithmic Problem Solving /
Algorithm Design & Analysis Process
12
13
What does it mean to understand
the problem?
 What are the problem objects?
 What are the operations applied to the objects?
Deciding on computational
means
 How the objects would be represented?
 How the operations would be implemented?
14
Design an algorithm
• Build a computational model of the
solving process
Prove correctness
• Correct output for every legitimate input
in finite time
• Based on correct math formula
• By induction
15
Analyze the algorithm
Efficiency: time and space
Simplicity:
Generality: range of inputs, special cases
Optimality: no other algorithm can do better
Coding
How the objects and operations in the
algorithm are represented in the chosen
programming language?
16
Important problem types
 Sorting
 Searching
 String processing
 Graph problems
 Combinatorial problems
 Geometric problems
 Numerical problems
17
Fundamental data structures
Linear data structures
 Array
 Linked list
 Stack
 Queue
Operations: search, delete, insert
Implementation: static, dynamic
18
Non-linear data structures
 Graphs
 Trees : connected graph without cycles
Rooted trees
 Ordered trees
Binary trees
Graph representation: adjacency lists,
adjacency matrix
Tree representation: as graphs; binary nodes
Fundamental data structures
19
Fundamental data structures
Sets, Bags, Dictionaries
 Set: unordered collection of distinct elements
Operations: membership, union, intersection
Representation: bit string; linear structure
 Bag: unordered collection,
elements may be repeated
 Dictionary: a bag with operations search, add,
delete
20
Conclusion
 Algorithm classification
By types of problems
By design technique
 Design techniques
a general approach to solving problems
Check if you are Clear with:
 Definition of Algorithm
 Notation of Algorithm
 Examples: GCD and Prime
 Fundamentals of Algorithms / Process of
Design & Analysis of Algorithms
 Types of Problems
 Fundamental Data Structures
21
Have a GREAT Day..!!!
22

More Related Content

PPT
UNIT-1-PPTS-DAA.ppt
PPTX
Daa unit 1
PDF
Daa notes 1
PPT
DESIGN AND ANALYSIS OF ALGORITHMS
PPTX
Complexity analysis in Algorithms
PDF
Design & Analysis of Algorithms Lecture Notes
PPTX
Performance analysis(Time & Space Complexity)
PPTX
Analysis and Design of Algorithms
UNIT-1-PPTS-DAA.ppt
Daa unit 1
Daa notes 1
DESIGN AND ANALYSIS OF ALGORITHMS
Complexity analysis in Algorithms
Design & Analysis of Algorithms Lecture Notes
Performance analysis(Time & Space Complexity)
Analysis and Design of Algorithms

What's hot (20)

PPTX
Asymptotic Notations
PPT
Divide and conquer
PDF
Design and analysis of algorithms
PPT
BackTracking Algorithm: Technique and Examples
PPT
Asymptotic notations
PDF
Algorithms Lecture 2: Analysis of Algorithms I
DOC
Time and space complexity
PDF
Algorithms Lecture 1: Introduction to Algorithms
PPT
Divide and Conquer
PPTX
Asymptotic Notation
PDF
Algorithms Lecture 5: Sorting Algorithms II
PDF
Algorithms Lecture 7: Graph Algorithms
PPTX
Divide and Conquer - Part 1
PPTX
Strassen's matrix multiplication
PPT
Asymptotic Notation and Complexity
PPTX
daa-unit-3-greedy method
PDF
I.BEST FIRST SEARCH IN AI
PDF
Lecture 2 role of algorithms in computing
PPTX
Design and Analysis of Algorithms.pptx
PPT
chapter 1
Asymptotic Notations
Divide and conquer
Design and analysis of algorithms
BackTracking Algorithm: Technique and Examples
Asymptotic notations
Algorithms Lecture 2: Analysis of Algorithms I
Time and space complexity
Algorithms Lecture 1: Introduction to Algorithms
Divide and Conquer
Asymptotic Notation
Algorithms Lecture 5: Sorting Algorithms II
Algorithms Lecture 7: Graph Algorithms
Divide and Conquer - Part 1
Strassen's matrix multiplication
Asymptotic Notation and Complexity
daa-unit-3-greedy method
I.BEST FIRST SEARCH IN AI
Lecture 2 role of algorithms in computing
Design and Analysis of Algorithms.pptx
chapter 1
Ad

Similar to Unit 1 chapter 1 Design and Analysis of Algorithms (20)

PPT
l01-intro (3).ppt
PPT
L01 intro-daa - ppt1
PDF
Design and Analysis Algorithms.pdf
PPTX
DAA 1 ppt.pptx
PPTX
DAA ppt.pptx
PPT
Types of Algorithms.ppt
PPTX
IntroductionToAlgo_v1_1709293290768 (2).pptx
PPTX
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
PPTX
Algorithm & data structures lec1
PPT
UnitI (1).ppt
PPT
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
PDF
Lecture 1 (bce-7)
PDF
ADA complete notes
PPTX
Design and Analysis of Algorithm for II year Computer science and Engineering...
PPT
Data structure and algorithm first chapter
PPTX
Chapter 1 Data structure _Algorithms.pptx
PDF
01 CS316_Introduction.pdf5959695559655565
PPTX
Chapter 1 - Algorithm Analysis & Design 2021
PPTX
Data Structure and Algorithms.pptx
l01-intro (3).ppt
L01 intro-daa - ppt1
Design and Analysis Algorithms.pdf
DAA 1 ppt.pptx
DAA ppt.pptx
Types of Algorithms.ppt
IntroductionToAlgo_v1_1709293290768 (2).pptx
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
Algorithm & data structures lec1
UnitI (1).ppt
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
Lecture 1 (bce-7)
ADA complete notes
Design and Analysis of Algorithm for II year Computer science and Engineering...
Data structure and algorithm first chapter
Chapter 1 Data structure _Algorithms.pptx
01 CS316_Introduction.pdf5959695559655565
Chapter 1 - Algorithm Analysis & Design 2021
Data Structure and Algorithms.pptx
Ad

More from P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai (20)

PPTX
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
PPTX
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
PPTX
PDF
PDF
The stable marriage problem iterative improvement method
PDF
Maximum matching in bipartite graphs iterative improvement method
PDF
Knapsack dynamic programming formula top down (1)
PDF
PDF
Multiplication of integers & strassens matrix multiplication subi notes
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
The stable marriage problem iterative improvement method
Maximum matching in bipartite graphs iterative improvement method
Knapsack dynamic programming formula top down (1)
Multiplication of integers & strassens matrix multiplication subi notes

Recently uploaded (20)

PPTX
Simulation of electric circuit laws using tinkercad.pptx
PDF
B.Tech (Electrical Engineering ) 2024 syllabus.pdf
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PPTX
Practice Questions on recent development part 1.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
24AI201_AI_Unit_4 (1).pptx Artificial intelligence
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
classification of cubic lattice structure
PDF
Queuing formulas to evaluate throughputs and servers
PPTX
Glazing at Facade, functions, types of glazing
PPTX
Soil science - sampling procedures for soil science lab
PPTX
anatomy of limbus and anterior chamber .pptx
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
PDF
flutter Launcher Icons, Splash Screens & Fonts
PDF
MCAD-Guidelines. Modernization of command Area Development, Guideines
PDF
ETO & MEO Certificate of Competency Questions and Answers
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
Simulation of electric circuit laws using tinkercad.pptx
B.Tech (Electrical Engineering ) 2024 syllabus.pdf
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
Practice Questions on recent development part 1.pptx
Lesson 3_Tessellation.pptx finite Mathematics
24AI201_AI_Unit_4 (1).pptx Artificial intelligence
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
classification of cubic lattice structure
Queuing formulas to evaluate throughputs and servers
Glazing at Facade, functions, types of glazing
Soil science - sampling procedures for soil science lab
anatomy of limbus and anterior chamber .pptx
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
flutter Launcher Icons, Splash Screens & Fonts
MCAD-Guidelines. Modernization of command Area Development, Guideines
ETO & MEO Certificate of Competency Questions and Answers
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
July 2025: Top 10 Read Articles Advanced Information Technology

Unit 1 chapter 1 Design and Analysis of Algorithms

  • 1. The Design and Analysis of Algorithms by Anany Levitin
  • 2. 2 CHAPTER 1: INTRODUCTIONCHAPTER 1: INTRODUCTION  What is an Algorithm  Steps in Designing and Implementing an Algorithm  Important Problem Types  Fundamental Data Structures
  • 3. 3 ALGORITHM  A sequence of unambiguous instructions for solving a problem, i.e. for obtaining the required output for any legitimate input in a finite amount of time
  • 4. Notation of the Algorithm 4
  • 5. 5 Special Features of Algorithms  Non-ambiguity  Range of inputs  The same algorithm can be represented in different ways  Several algorithms for solving the same problem  Different algorithms with different speeds
  • 6. Find the GCD(m,n) Method 1: Descriptive Algorithm 6
  • 7. GCD using Euclid’s Method gcd(m,n)=gcd(n,m nod n) Find: 1. GCD(124,12) 2. GCD(160,15) 3. GCD(338,22) 4. GCD(150,8) 7
  • 8. Find the GCD(m,n) Method 2: Descriptive Algorithm 8
  • 9. Find the GCD(m,n) Method 2: Pseudocode Representation 9
  • 10. Find the set of all Prime numbers Method 1: Middle School Level Find Set of ALL Prime Numbers within 25 10
  • 11. Find the set of all Prime numbers Method 2: Sieve of Erathosthenes Find Set of ALL Prime Numbers within 25 11
  • 12. Fundamentals of Algorithmic Problem Solving / Algorithm Design & Analysis Process 12
  • 13. 13 What does it mean to understand the problem?  What are the problem objects?  What are the operations applied to the objects? Deciding on computational means  How the objects would be represented?  How the operations would be implemented?
  • 14. 14 Design an algorithm • Build a computational model of the solving process Prove correctness • Correct output for every legitimate input in finite time • Based on correct math formula • By induction
  • 15. 15 Analyze the algorithm Efficiency: time and space Simplicity: Generality: range of inputs, special cases Optimality: no other algorithm can do better Coding How the objects and operations in the algorithm are represented in the chosen programming language?
  • 16. 16 Important problem types  Sorting  Searching  String processing  Graph problems  Combinatorial problems  Geometric problems  Numerical problems
  • 17. 17 Fundamental data structures Linear data structures  Array  Linked list  Stack  Queue Operations: search, delete, insert Implementation: static, dynamic
  • 18. 18 Non-linear data structures  Graphs  Trees : connected graph without cycles Rooted trees  Ordered trees Binary trees Graph representation: adjacency lists, adjacency matrix Tree representation: as graphs; binary nodes Fundamental data structures
  • 19. 19 Fundamental data structures Sets, Bags, Dictionaries  Set: unordered collection of distinct elements Operations: membership, union, intersection Representation: bit string; linear structure  Bag: unordered collection, elements may be repeated  Dictionary: a bag with operations search, add, delete
  • 20. 20 Conclusion  Algorithm classification By types of problems By design technique  Design techniques a general approach to solving problems
  • 21. Check if you are Clear with:  Definition of Algorithm  Notation of Algorithm  Examples: GCD and Prime  Fundamentals of Algorithms / Process of Design & Analysis of Algorithms  Types of Problems  Fundamental Data Structures 21
  • 22. Have a GREAT Day..!!! 22