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

PDF
Design and analysis of algorithms
PPTX
Control Statements in Java
PPTX
Daa unit 1
PDF
The Design and Analysis of Algorithms.pdf
PPTX
Introduction to Data Science
PPTX
Introduction to IoT (Basics of Networking & Emergence of IoT).pptx
PPTX
Object Oriented Programming
PDF
UNIT 1 -BIG DATA ANALYTICS Full.pdf
Design and analysis of algorithms
Control Statements in Java
Daa unit 1
The Design and Analysis of Algorithms.pdf
Introduction to Data Science
Introduction to IoT (Basics of Networking & Emergence of IoT).pptx
Object Oriented Programming
UNIT 1 -BIG DATA ANALYTICS Full.pdf

What's hot (20)

PPTX
Webinar : P, NP, NP-Hard , NP - Complete problems
PPT
DESIGN AND ANALYSIS OF ALGORITHMS
PDF
Algorithms Lecture 2: Analysis of Algorithms I
PDF
Time and Space Complexity
DOC
Time and space complexity
PPT
Complexity of Algorithm
PPTX
Complexity analysis in Algorithms
PPTX
Data structure - Graph
PDF
Daa notes 1
PDF
Algorithms Lecture 1: Introduction to Algorithms
PPTX
Analysis of algorithm
PPT
Algorithm analysis
PPTX
Priority Queue in Data Structure
PDF
P, NP, NP-Complete, and NP-Hard
PPT
Dinive conquer algorithm
PPTX
Stack data structure
PPTX
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
PPTX
Breadth First Search & Depth First Search
PPT
Hashing PPT
PDF
Design & Analysis of Algorithms Lecture Notes
Webinar : P, NP, NP-Hard , NP - Complete problems
DESIGN AND ANALYSIS OF ALGORITHMS
Algorithms Lecture 2: Analysis of Algorithms I
Time and Space Complexity
Time and space complexity
Complexity of Algorithm
Complexity analysis in Algorithms
Data structure - Graph
Daa notes 1
Algorithms Lecture 1: Introduction to Algorithms
Analysis of algorithm
Algorithm analysis
Priority Queue in Data Structure
P, NP, NP-Complete, and NP-Hard
Dinive conquer algorithm
Stack data structure
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Breadth First Search & Depth First Search
Hashing PPT
Design & Analysis of Algorithms Lecture Notes
Ad

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

PPT
l01-intro (3).ppt
PPT
L01 intro-daa - ppt1
PDF
Algorithm chapter 1
PPTX
Chapter one
PPT
02-FAZ-A First Step Toward Algorithm Complexity Analysis.ppt
PPTX
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
PPTX
IntroductionToAlgo_v1_1709293290768 (2).pptx
PPTX
DAA ppt.pptx
PPTX
DAA 1 ppt.pptx
PPTX
Unit 2 algorithm
PPT
UnitI (1).ppt
PPT
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
PPTX
Design Analysis of Alogorithm 1 ppt 2024.pptx
PPTX
Analysis of Algorithm full version 2024.pptx
PPT
chapter 1
PPTX
Design and Analysis of Algorithm for II year Computer science and Engineering...
PPTX
Introduction to Design and Analysis of Algorithms
PPT
ALGO.ppt
l01-intro (3).ppt
L01 intro-daa - ppt1
Algorithm chapter 1
Chapter one
02-FAZ-A First Step Toward Algorithm Complexity Analysis.ppt
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
IntroductionToAlgo_v1_1709293290768 (2).pptx
DAA ppt.pptx
DAA 1 ppt.pptx
Unit 2 algorithm
UnitI (1).ppt
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
Design Analysis of Alogorithm 1 ppt 2024.pptx
Analysis of Algorithm full version 2024.pptx
chapter 1
Design and Analysis of Algorithm for II year Computer science and Engineering...
Introduction to Design and Analysis of Algorithms
ALGO.ppt
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
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Geodesy 1.pptx...............................................
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
Well-logging-methods_new................
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
PPT on Performance Review to get promotions
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPT
Project quality management in manufacturing
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Sustainable Sites - Green Building Construction
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CYBER-CRIMES AND SECURITY A guide to understanding
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Lesson 3_Tessellation.pptx finite Mathematics
Geodesy 1.pptx...............................................
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Digital Logic Computer Design lecture notes
Well-logging-methods_new................
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Operating System & Kernel Study Guide-1 - converted.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPT on Performance Review to get promotions
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Foundation to blockchain - A guide to Blockchain Tech
Project quality management in manufacturing
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Internet of Things (IOT) - A guide to understanding
Sustainable Sites - Green Building Construction
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

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