SlideShare a Scribd company logo
The Design and
Analysis of
Algorithms
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
4
Important points
 Non-ambiguityNon-ambiguity
 Range of inputsRange of inputs
 The same algorithm can beThe same algorithm can be
represented in different waysrepresented in different ways
 Several algorithms for solving theSeveral algorithms for solving the
same problemsame problem
 Finiteness
5
GCD
3 methods
1.euclid alg
2.integer check alg
3.find repititive factors
ex : 60 and 24
Fundamentals
of Algorithmic
problem solving
6
7
Understand the problem
Decide on computational means
Exact vs approximate solution
Data structures
Algorithm design technique
Design an algorithm
Prove correctness
Analyze the algorithm
Code the algorithm
8
Understanding the problem:
understand the problem completely by Read the problem description
carefully and clear the doubts.
Specify exactly the range of inputs the algorithm need to handle.
Once the problem is clearly understandable, then determine the overall
goals but it should be in a precise manner.
Then divide the problem into smaller problems until they become
manageable size
9
Ascertaining the capabilities of a computational device ()
Sequential Algorithm:
Instructions are executed one after another, one operation at a time.
This is implemented in RAM model.
Parallel Algorithm: Instructions are executed in parallel or concurrently
10
Choosing between exact and appropriate problem solving :
The algorithm used to solve the problem exactly called exact algorithm.
The algorithm used to solve the problem approximately is called
approximation algorithm
Optimal and feasible solution ( explain example)
11
Deciding on appropriate data structures
Data structure is important for both design and analysis of algorithms.
Algorithm + Data Structures = Programs.
In Object Oriented Programming, the data structure is important for both
design and analysis of algorithms.
The variability in algorithm is due to the data structure in which the data of
the program are stored such as
1.How the data are arranged in relation to each other.
2.Which data are kept in memory
3.Which data are kept in files and how the files are arranged. Which data
are calculated when needed?
12
13
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
14
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?
15
Important problem types
 Sorting
 Searching
 String processing
 Graph problems
 Combinatorial problems
 Geometric problems
 Numerical problems
Sorting
 Arranging the elements in increasing order
or in decreasing order.
 The sorting can be done on numbers ,
characters (alphabets), string or employees
record.
 EX :ANNA UNIV RANK,SPORTS,BANK
 1. Bubble sort, 2. Selection sort
 3. Shell sort , 4. Insertion sort
 5. Quick sort , 6. Heap sort
16
Searching
 One of the important applications of array is
searching,
 Searching is an activity by which we can
find out the desired element from the list.
 The element which is to be searched is
called search key.
 There are many searching algorithm such
as sequential search , Fibonacci search
and more.
17
String processing
 A string is a collection of characters from an alphabet.
 Different type of strings are
 Text String
It is a collection of letters, numbers and special
characters.
 Bit String
It is collection of zeros and ones.
18
Graph problems
 Graph is a collection of vertices and edges. a graph
 G={ V, E }.
 The graph problems involve graph traversal algorithms,
shortest path algorithm and topological sorting and so
on.
 Some graph problems are very hard to solve. For
example travelling salesman problem, graph colouring
problems
19
Combinatorial problems
 The travelling salesman problem and the
graph colouring problems are examples of
combinatorial problems.
 A combinatorial object such as a
permutation a combination or a subset
that satisfies certain constraints and has
some desired property such as maximizes
a value or minimizes a cost should be find.
20
Combinatorial problems 2
 Combinatorial problems are the most difficult problems.
1. As problem size grows the combinatorial objects grow
rapidly and reach to huge value. size.
2. There is no algorithms available which can solve these
problems in finite amount of time
3. Many of these problems fall in the category of unsolvable
problem.
Some combinatorial problems can be solved by efficient
algorithms
21
Geometric problems
 Geometric algorithms deal with geometric objects such as points ,lines
and polygons.
 The procedure for solving a variety of geometric problems includes
the problems of constructing simple geometric shapes such as
triangles, circles and so on.
 The two classic problems of computational geometry are the
 1. Closest pair problem
 2. Convex hull problem
 The closest pair problem is self explanatory. Given n points in the
plane, find the closest pair among them.The convex hull problem is
used to find the smallest convex polygon that would include all the
points of a given set.
 The geometric problems are solved mainly in applications to computer
graphics or in robotics
22
Numerical problems
 Numerical problems are problems that involve
mathematical objects of continuous nature such
as solving equations and systems of equations
computing definite integrals evaluating functions
and so on.
 Most of the mathematical problems can be solved
approximate algorithms.
 These algorithms require manipulating of the real
numbers; hence we may get wrong output many
times.
23
24
Fundamental data structures
Linear data structures
 Array
 Linked list
 Stack
 Queue
Operations: search, delete, insert
Implementation: static, dynamic
25
Non-linear data structures
 Graphs
 Trees : connected graph without
cycles
Rooted trees
 Ordered trees
Binary treesGraph representation: adjacency lists,
adjacency matrix
Tree representation: as graphs; binary
nodes
Fundamental data structures
26
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
27
Conclusion
 Algorithm classification
By types of problems
By design technique
 Design techniques
a general approach to solving problems

More Related Content

PDF
Numerical Methods - Power Method for Eigen values
Dr. Nirav Vyas
 
PPTX
MATCHING GRAPH THEORY
garishma bhatia
 
PPTX
Stressen's matrix multiplication
Kumar
 
PPTX
Graph theory
iranian translate
 
PPTX
Graphs in data structure
hamza javed
 
PPTX
Planar graph
Shakil Ahmed
 
PDF
Matlab Graphics Tutorial
Cheng-An Yang
 
PPT
Branch and bound
Dr Shashikant Athawale
 
Numerical Methods - Power Method for Eigen values
Dr. Nirav Vyas
 
MATCHING GRAPH THEORY
garishma bhatia
 
Stressen's matrix multiplication
Kumar
 
Graph theory
iranian translate
 
Graphs in data structure
hamza javed
 
Planar graph
Shakil Ahmed
 
Matlab Graphics Tutorial
Cheng-An Yang
 
Branch and bound
Dr Shashikant Athawale
 

What's hot (20)

PPTX
Dijkstra's Algorithm
Rashik Ishrak Nahian
 
PDF
Graph Theory: Trees
Ashikur Rahman
 
PPTX
daa-unit-3-greedy method
hodcsencet
 
PPTX
strassen matrix multiplication algorithm
evil eye
 
PPTX
Application of Numerical method in Real Life
Taqwa It Center
 
PPTX
Greedy Algorithm - Knapsack Problem
Madhu Bala
 
PPTX
Strassen's matrix multiplication
Megha V
 
PPTX
Travelling salesman problem
Dimitris Mavrommatis
 
PPTX
0/1 DYNAMIC PROGRAMMING KNAPSACK PROBLEM
Mrunal Patil
 
PPT
Perceptron
Nagarajan
 
PPTX
Artificial bee colony algorithm
Satyasis Mishra
 
PPT
Knapsack problem and Memory Function
Barani Tharan
 
PPT
Knapsack problem using dynamic programming
khush_boo31
 
PDF
ADVANCED OPTIMIZATION TECHNIQUES META-HEURISTIC ALGORITHMS FOR ENGINEERING AP...
Ajay Kumar
 
PPT
Minimum spanning tree
Hinal Lunagariya
 
PPTX
Multilayer perceptron
omaraldabash
 
PPTX
Planar graph( Algorithm and Application )
Abdullah Moin
 
PPTX
Asymptotic Notation and Data Structures
Amrinder Arora
 
PDF
CSC446: Pattern Recognition (LN6)
Mostafa G. M. Mostafa
 
PPTX
01 Knapsack using Dynamic Programming
Fenil Shah
 
Dijkstra's Algorithm
Rashik Ishrak Nahian
 
Graph Theory: Trees
Ashikur Rahman
 
daa-unit-3-greedy method
hodcsencet
 
strassen matrix multiplication algorithm
evil eye
 
Application of Numerical method in Real Life
Taqwa It Center
 
Greedy Algorithm - Knapsack Problem
Madhu Bala
 
Strassen's matrix multiplication
Megha V
 
Travelling salesman problem
Dimitris Mavrommatis
 
0/1 DYNAMIC PROGRAMMING KNAPSACK PROBLEM
Mrunal Patil
 
Perceptron
Nagarajan
 
Artificial bee colony algorithm
Satyasis Mishra
 
Knapsack problem and Memory Function
Barani Tharan
 
Knapsack problem using dynamic programming
khush_boo31
 
ADVANCED OPTIMIZATION TECHNIQUES META-HEURISTIC ALGORITHMS FOR ENGINEERING AP...
Ajay Kumar
 
Minimum spanning tree
Hinal Lunagariya
 
Multilayer perceptron
omaraldabash
 
Planar graph( Algorithm and Application )
Abdullah Moin
 
Asymptotic Notation and Data Structures
Amrinder Arora
 
CSC446: Pattern Recognition (LN6)
Mostafa G. M. Mostafa
 
01 Knapsack using Dynamic Programming
Fenil Shah
 
Ad

Similar to L01 intro-daa - ppt1 (20)

PDF
Design and analysis of algorithms
Dr Geetha Mohan
 
PPT
l01-intro (3).ppt
ssuser15a62a
 
PPT
Unit 1 chapter 1 Design and Analysis of Algorithms
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
PPT
Types of Algorithms.ppt
ALIZAIB KHAN
 
PDF
Lecture 1 (bce-7)
farazahmad005
 
PPTX
Data Structure and Algorithms.pptx
Syed Zaid Irshad
 
PPT
Design and Analysis of algorithms unit 1 notes
sangeja1
 
PPTX
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
christinamary2620
 
PDF
Lecture 2 role of algorithms in computing
jayavignesh86
 
PPTX
Chapter 1 - Algorithm Analysis & Design 2021
g46179042
 
PDF
Design and Analysis Algorithms.pdf
HarshNagda5
 
PPTX
19. Java data structures algorithms and complexity
Intro C# Book
 
PPTX
EE-232-LEC-01 Data_structures.pptx
iamultapromax
 
PPTX
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
AIET
 
PPTX
Chapter one
mihiretu kassaye
 
PPTX
Chapter 1 Data structure _Algorithms.pptx
BifaHirpo1
 
PPTX
data structure and algoriythm pres.pptxD
dubaay100
 
PDF
Nguyễn Nho Vĩnh - Problem solvingwithalgorithmsanddatastructures
Nguyễn Nho Vĩnh
 
PPTX
Design and Analysis of Algorithm for II year Computer science and Engineering...
Kalpana Devi M
 
Design and analysis of algorithms
Dr Geetha Mohan
 
l01-intro (3).ppt
ssuser15a62a
 
Unit 1 chapter 1 Design and Analysis of Algorithms
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
Types of Algorithms.ppt
ALIZAIB KHAN
 
Lecture 1 (bce-7)
farazahmad005
 
Data Structure and Algorithms.pptx
Syed Zaid Irshad
 
Design and Analysis of algorithms unit 1 notes
sangeja1
 
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
christinamary2620
 
Lecture 2 role of algorithms in computing
jayavignesh86
 
Chapter 1 - Algorithm Analysis & Design 2021
g46179042
 
Design and Analysis Algorithms.pdf
HarshNagda5
 
19. Java data structures algorithms and complexity
Intro C# Book
 
EE-232-LEC-01 Data_structures.pptx
iamultapromax
 
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
AIET
 
Chapter one
mihiretu kassaye
 
Chapter 1 Data structure _Algorithms.pptx
BifaHirpo1
 
data structure and algoriythm pres.pptxD
dubaay100
 
Nguyễn Nho Vĩnh - Problem solvingwithalgorithmsanddatastructures
Nguyễn Nho Vĩnh
 
Design and Analysis of Algorithm for II year Computer science and Engineering...
Kalpana Devi M
 
Ad

Recently uploaded (20)

PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PPTX
Inventory management chapter in automation and robotics.
atisht0104
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PPTX
22PCOAM21 Data Quality Session 3 Data Quality.pptx
Guru Nanak Technical Institutions
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PPTX
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
Inventory management chapter in automation and robotics.
atisht0104
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
Ppt for engineering students application on field effect
lakshmi.ec
 
22PCOAM21 Data Quality Session 3 Data Quality.pptx
Guru Nanak Technical Institutions
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
Software Testing Tools - names and explanation
shruti533256
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 

L01 intro-daa - ppt1

  • 1. The Design and Analysis of Algorithms
  • 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. 4 Important points  Non-ambiguityNon-ambiguity  Range of inputsRange of inputs  The same algorithm can beThe same algorithm can be represented in different waysrepresented in different ways  Several algorithms for solving theSeveral algorithms for solving the same problemsame problem  Finiteness
  • 5. 5 GCD 3 methods 1.euclid alg 2.integer check alg 3.find repititive factors ex : 60 and 24
  • 7. 7 Understand the problem Decide on computational means Exact vs approximate solution Data structures Algorithm design technique Design an algorithm Prove correctness Analyze the algorithm Code the algorithm
  • 8. 8 Understanding the problem: understand the problem completely by Read the problem description carefully and clear the doubts. Specify exactly the range of inputs the algorithm need to handle. Once the problem is clearly understandable, then determine the overall goals but it should be in a precise manner. Then divide the problem into smaller problems until they become manageable size
  • 9. 9 Ascertaining the capabilities of a computational device () Sequential Algorithm: Instructions are executed one after another, one operation at a time. This is implemented in RAM model. Parallel Algorithm: Instructions are executed in parallel or concurrently
  • 10. 10 Choosing between exact and appropriate problem solving : The algorithm used to solve the problem exactly called exact algorithm. The algorithm used to solve the problem approximately is called approximation algorithm Optimal and feasible solution ( explain example)
  • 11. 11 Deciding on appropriate data structures Data structure is important for both design and analysis of algorithms. Algorithm + Data Structures = Programs. In Object Oriented Programming, the data structure is important for both design and analysis of algorithms. The variability in algorithm is due to the data structure in which the data of the program are stored such as 1.How the data are arranged in relation to each other. 2.Which data are kept in memory 3.Which data are kept in files and how the files are arranged. Which data are calculated when needed?
  • 12. 12
  • 13. 13 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
  • 14. 14 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?
  • 15. 15 Important problem types  Sorting  Searching  String processing  Graph problems  Combinatorial problems  Geometric problems  Numerical problems
  • 16. Sorting  Arranging the elements in increasing order or in decreasing order.  The sorting can be done on numbers , characters (alphabets), string or employees record.  EX :ANNA UNIV RANK,SPORTS,BANK  1. Bubble sort, 2. Selection sort  3. Shell sort , 4. Insertion sort  5. Quick sort , 6. Heap sort 16
  • 17. Searching  One of the important applications of array is searching,  Searching is an activity by which we can find out the desired element from the list.  The element which is to be searched is called search key.  There are many searching algorithm such as sequential search , Fibonacci search and more. 17
  • 18. String processing  A string is a collection of characters from an alphabet.  Different type of strings are  Text String It is a collection of letters, numbers and special characters.  Bit String It is collection of zeros and ones. 18
  • 19. Graph problems  Graph is a collection of vertices and edges. a graph  G={ V, E }.  The graph problems involve graph traversal algorithms, shortest path algorithm and topological sorting and so on.  Some graph problems are very hard to solve. For example travelling salesman problem, graph colouring problems 19
  • 20. Combinatorial problems  The travelling salesman problem and the graph colouring problems are examples of combinatorial problems.  A combinatorial object such as a permutation a combination or a subset that satisfies certain constraints and has some desired property such as maximizes a value or minimizes a cost should be find. 20
  • 21. Combinatorial problems 2  Combinatorial problems are the most difficult problems. 1. As problem size grows the combinatorial objects grow rapidly and reach to huge value. size. 2. There is no algorithms available which can solve these problems in finite amount of time 3. Many of these problems fall in the category of unsolvable problem. Some combinatorial problems can be solved by efficient algorithms 21
  • 22. Geometric problems  Geometric algorithms deal with geometric objects such as points ,lines and polygons.  The procedure for solving a variety of geometric problems includes the problems of constructing simple geometric shapes such as triangles, circles and so on.  The two classic problems of computational geometry are the  1. Closest pair problem  2. Convex hull problem  The closest pair problem is self explanatory. Given n points in the plane, find the closest pair among them.The convex hull problem is used to find the smallest convex polygon that would include all the points of a given set.  The geometric problems are solved mainly in applications to computer graphics or in robotics 22
  • 23. Numerical problems  Numerical problems are problems that involve mathematical objects of continuous nature such as solving equations and systems of equations computing definite integrals evaluating functions and so on.  Most of the mathematical problems can be solved approximate algorithms.  These algorithms require manipulating of the real numbers; hence we may get wrong output many times. 23
  • 24. 24 Fundamental data structures Linear data structures  Array  Linked list  Stack  Queue Operations: search, delete, insert Implementation: static, dynamic
  • 25. 25 Non-linear data structures  Graphs  Trees : connected graph without cycles Rooted trees  Ordered trees Binary treesGraph representation: adjacency lists, adjacency matrix Tree representation: as graphs; binary nodes Fundamental data structures
  • 26. 26 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
  • 27. 27 Conclusion  Algorithm classification By types of problems By design technique  Design techniques a general approach to solving problems