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

What's hot

Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock Detection
Stuart Joy
 
Lab management
Lab managementLab management
Lab management
logumca
 
Interpreter Design Pattern
Interpreter Design PatternInterpreter Design Pattern
Interpreter Design Pattern
sreymoch
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
Karam Munir Butt
 
Mutual exclusion and sync
Mutual exclusion and syncMutual exclusion and sync
Mutual exclusion and sync
Dr. C.V. Suresh Babu
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
MNM Jain Engineering College
 
data structures- back tracking
data structures- back trackingdata structures- back tracking
data structures- back tracking
Abinaya B
 
Plant disease detection and classification using deep learning
Plant disease detection and classification using deep learning Plant disease detection and classification using deep learning
Plant disease detection and classification using deep learning
JAVAID AHMAD WANI
 
Ai notes
Ai notesAi notes
Ai notes
AbdullahGubbi1
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
Ali Haider
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
Fahim Ferdous
 
Learning in AI
Learning in AILearning in AI
Learning in AI
Minakshi Atre
 
Food donation project report II
Food donation project report IIFood donation project report II
Food donation project report II
Dhananjaysinh Jhala
 
Computer networks protocols
Computer networks protocolsComputer networks protocols
Computer networks protocols
Mustafa Qamar-ud-Din
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
United International University
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
Kumar
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
Abhishek Singh
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
Ashish Kumar
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
Rushdi Shams
 

What's hot (20)

Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock Detection
 
Lab management
Lab managementLab management
Lab management
 
Interpreter Design Pattern
Interpreter Design PatternInterpreter Design Pattern
Interpreter Design Pattern
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
 
Mutual exclusion and sync
Mutual exclusion and syncMutual exclusion and sync
Mutual exclusion and sync
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
data structures- back tracking
data structures- back trackingdata structures- back tracking
data structures- back tracking
 
Plant disease detection and classification using deep learning
Plant disease detection and classification using deep learning Plant disease detection and classification using deep learning
Plant disease detection and classification using deep learning
 
Ai notes
Ai notesAi notes
Ai notes
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
 
Learning in AI
Learning in AILearning in AI
Learning in AI
 
Food donation project report II
Food donation project report IIFood donation project report II
Food donation project report II
 
Computer networks protocols
Computer networks protocolsComputer networks protocols
Computer networks protocols
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 

Similar to L01 intro-daa - ppt1

Day 2 Chapter 1 Unit 1
Day 2 Chapter 1 Unit 1Day 2 Chapter 1 Unit 1
l01-intro (3).ppt
l01-intro (3).pptl01-intro (3).ppt
l01-intro (3).ppt
ssuser15a62a
 
DAA 1 ppt.pptx
DAA 1 ppt.pptxDAA 1 ppt.pptx
DAA 1 ppt.pptx
RAJESH S
 
DAA ppt.pptx
DAA ppt.pptxDAA ppt.pptx
DAA ppt.pptx
RAJESH S
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
Day 1 Chapter 1 Unit 1
Day 1 Chapter 1 Unit 1Day 1 Chapter 1 Unit 1
chapter 1
chapter 1chapter 1
chapter 1
yatheesha
 
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
a581a6a2cb5778045788f0b1d7da1c0236f.pptxa581a6a2cb5778045788f0b1d7da1c0236f.pptx
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
christinamary2620
 
UnitI (1).ppt
UnitI (1).pptUnitI (1).ppt
UnitI (1).ppt
DSirisha2
 
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
ANALYSIS-AND-DESIGN-OF-ALGORITHM.pptANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
DaveCalapis3
 
Algorithm chapter 1
Algorithm chapter 1Algorithm chapter 1
Algorithm chapter 1
chidabdu
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
Computer Hardware & Trouble shooting
 
CP4151 Advanced data structures and algorithms
CP4151 Advanced data structures and algorithmsCP4151 Advanced data structures and algorithms
CP4151 Advanced data structures and algorithms
Sheba41
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
Mary Margarat
 
Chapter one
Chapter oneChapter one
Chapter one
mihiretu kassaye
 
8.unit-1-fds-2022-23.pptx
8.unit-1-fds-2022-23.pptx8.unit-1-fds-2022-23.pptx
8.unit-1-fds-2022-23.pptx
RavishankarBhaganaga
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of AlgorithmsCS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of Algorithms
Krishnan MuthuManickam
 
19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf
GOWTHAMR721887
 
Introduction to Artificial Intelligence...pptx
Introduction to Artificial Intelligence...pptxIntroduction to Artificial Intelligence...pptx
Introduction to Artificial Intelligence...pptx
MMCOE, Karvenagar, Pune
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
Dr Geetha Mohan
 

Similar to L01 intro-daa - ppt1 (20)

Day 2 Chapter 1 Unit 1
Day 2 Chapter 1 Unit 1Day 2 Chapter 1 Unit 1
Day 2 Chapter 1 Unit 1
 
l01-intro (3).ppt
l01-intro (3).pptl01-intro (3).ppt
l01-intro (3).ppt
 
DAA 1 ppt.pptx
DAA 1 ppt.pptxDAA 1 ppt.pptx
DAA 1 ppt.pptx
 
DAA ppt.pptx
DAA ppt.pptxDAA ppt.pptx
DAA ppt.pptx
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
 
Day 1 Chapter 1 Unit 1
Day 1 Chapter 1 Unit 1Day 1 Chapter 1 Unit 1
Day 1 Chapter 1 Unit 1
 
chapter 1
chapter 1chapter 1
chapter 1
 
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
a581a6a2cb5778045788f0b1d7da1c0236f.pptxa581a6a2cb5778045788f0b1d7da1c0236f.pptx
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
 
UnitI (1).ppt
UnitI (1).pptUnitI (1).ppt
UnitI (1).ppt
 
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
ANALYSIS-AND-DESIGN-OF-ALGORITHM.pptANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
 
Algorithm chapter 1
Algorithm chapter 1Algorithm chapter 1
Algorithm chapter 1
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
 
CP4151 Advanced data structures and algorithms
CP4151 Advanced data structures and algorithmsCP4151 Advanced data structures and algorithms
CP4151 Advanced data structures and algorithms
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
 
Chapter one
Chapter oneChapter one
Chapter one
 
8.unit-1-fds-2022-23.pptx
8.unit-1-fds-2022-23.pptx8.unit-1-fds-2022-23.pptx
8.unit-1-fds-2022-23.pptx
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of AlgorithmsCS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of Algorithms
 
19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf
 
Introduction to Artificial Intelligence...pptx
Introduction to Artificial Intelligence...pptxIntroduction to Artificial Intelligence...pptx
Introduction to Artificial Intelligence...pptx
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
 

Recently uploaded

官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
HODECEDSIET
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 

Recently uploaded (20)

官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 

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