SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
IMPORTANT PROBLEM TYPES
19IS402 – DESIGN AND ANALYSIS OF ALGORITHMS
TOPICS TO BE COVERED
● Sorting
● Searching
● String processing (e.g. string matching)
● Graph problems (e.g. graph coloring problem)
● Combinatorial problems (e.g. maximizes a cost)
● Geometric problems (e.g. convex hull problem)
● Numerical problems (e.g. solving equations )
GUESS!!!!!!
SORTING
● The sorting problem is to rearrange the items of a given list in nondecreasing
(ascending) order
● Sorting can be done on numbers, characters, strings or records
● Example: To sort student records in alphabetical order of names or by student
number or by student grade-point average. Such a specially chosen piece of
information is called a key
Sorting classification:
1. stable sorting - preserve the relative order of equal elements
2. unstable sorting - Doesn’t preserve the relative order of equal elements
Stable and UnstableAlgorithm
Example :
STABLE AND UNSTABLE SORT
IN-PLACE AND OUT OF PLACE SORTING
In-Place Sorting :
● Algorithm directly modifies the list that is received as input instead of creating a new
list that is then modified
● In-place sorting uses small amount of extra space to manipulate the input set
● In other Words, the output is placed in the correct position while the algorithm is still
executing, which means that the input will be overwritten by the desired output on
run-time
● In-Place, Sorting Algorithm updates input only through replacement or swapping of
elements
● An algorithm which is not in-place is sometimes called not-in-Place or out of Place
TYPES OF SORTING
1. Bubble sort, insertion sort, and selection sort are in-place sorting algorithms Because
only swapping of the element in the input array is required
2. Bubble sort and insertion sort can be applying as stable algorithms but selection sort
cannot
3. Merge sort is a stable algorithm but not an in-place algorithm. It requires extra array
storage
4. Quicksort is not stable but is an in-place algorithm
5. Heap sort is an in-place algorithm but is not stable
BUBBLE SORT AND INSERTION SORT - STABLE ALGORITHM
QUICK SORT & MERGE SORT
QUICK SORT - NOT STABLEALGORITHM
SEARCHING
The searching problem deals with finding a given value, called a search key, in a given set.
Types :
1. Linear search
a. Finding an element within a list.
b. It sequentially checks each element of the list until a match is found or the whole list has been searched
2. Binary search
a. Finding an item from a sorted list of items
b. It works by repeatedly dividing in half the portion of the list that could contain the item
LINEAR SEARCH
BINARY SEARCH
STRING PROCESSING
● Astring is a sequence of characters from an alphabet
● Strings comprise letters, numbers, and special characters; bit strings, which
comprise zeros and ones; and gene sequences, which can be modeled by
strings of characters from the four character alphabet {A, C, G, T}.
● It is very useful in bioinformatics
● Searching for a given word in a text is called string matching
STRING MATCHING PROBLEM
GRAPH PROBLEM
Graph problems: Agraph is a collection of points called vertices, some of which are
connected by line segments called edges
Examples:
1. Graph traversal
2. Shortest path algorithm
3. Topological sort
4. Traveling salesman problem
5. Graph-coloring problem and so on
COMBINATORIAL PROBLEMS
• combination, or a subset that satisfies certain constraints
● Adesired combinatorial object may also be required to have some additional property
such s a maximum value or a minimum cost.
● In practical, the combinatorial problems are the most difficult problems in computing.
• Example :
1. The traveling salesman problem
2. The graph coloring problem
● Combinatorial problems :To find a combinatorial object such as a permutation, a
GEOMETRICAL PROBLEMS
Geometric problems:
● Geometric algorithms deal with geometric objects such as points, lines, and polygons
● Geometric algorithms are used in computer graphics, robotics, and tomography
Examples :
1. The closest-pair problem
2. The convex-hull problem
19IS402_LP3.1_LM_22-23.pdf

Mais conteúdo relacionado

Semelhante a 19IS402_LP3.1_LM_22-23.pdf

Semelhante a 19IS402_LP3.1_LM_22-23.pdf (12)

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
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit 1.ppt
 
Paper 2 – Exam Revision Notes.pdf
Paper 2 – Exam Revision Notes.pdfPaper 2 – Exam Revision Notes.pdf
Paper 2 – Exam Revision Notes.pdf
 
Paper 2 – Exam Revision Notes.pdf
Paper 2 – Exam Revision Notes.pdfPaper 2 – Exam Revision Notes.pdf
Paper 2 – Exam Revision Notes.pdf
 
Pseudo code
Pseudo codePseudo code
Pseudo code
 
Day 2 Chapter 1 Unit 1
Day 2 Chapter 1 Unit 1Day 2 Chapter 1 Unit 1
Day 2 Chapter 1 Unit 1
 
Age Sort.pptx
Age Sort.pptxAge Sort.pptx
Age Sort.pptx
 
Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operations
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
(2) collections algorithms
(2) collections algorithms(2) collections algorithms
(2) collections algorithms
 

Mais de GOWTHAMR721887

19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdfGOWTHAMR721887
 
22PH102_ISE_U3_LP1_-_Notes.pdf
22PH102_ISE_U3_LP1_-_Notes.pdf22PH102_ISE_U3_LP1_-_Notes.pdf
22PH102_ISE_U3_LP1_-_Notes.pdfGOWTHAMR721887
 
22PH102_ISE_U2_LP1_-_Notes.pdf
22PH102_ISE_U2_LP1_-_Notes.pdf22PH102_ISE_U2_LP1_-_Notes.pdf
22PH102_ISE_U2_LP1_-_Notes.pdfGOWTHAMR721887
 
19IS303_22-23_LM11.pdf
19IS303_22-23_LM11.pdf19IS303_22-23_LM11.pdf
19IS303_22-23_LM11.pdfGOWTHAMR721887
 
19IS305_U2_LP4_LM4-22-23.pdf
19IS305_U2_LP4_LM4-22-23.pdf19IS305_U2_LP4_LM4-22-23.pdf
19IS305_U2_LP4_LM4-22-23.pdfGOWTHAMR721887
 
19IS305_U1_LP3_LM3-22-23-2.pdf
19IS305_U1_LP3_LM3-22-23-2.pdf19IS305_U1_LP3_LM3-22-23-2.pdf
19IS305_U1_LP3_LM3-22-23-2.pdfGOWTHAMR721887
 
An Internet of Things Based Smart Waste.pptx
An Internet of Things Based Smart Waste.pptxAn Internet of Things Based Smart Waste.pptx
An Internet of Things Based Smart Waste.pptxGOWTHAMR721887
 

Mais de GOWTHAMR721887 (7)

19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf
 
22PH102_ISE_U3_LP1_-_Notes.pdf
22PH102_ISE_U3_LP1_-_Notes.pdf22PH102_ISE_U3_LP1_-_Notes.pdf
22PH102_ISE_U3_LP1_-_Notes.pdf
 
22PH102_ISE_U2_LP1_-_Notes.pdf
22PH102_ISE_U2_LP1_-_Notes.pdf22PH102_ISE_U2_LP1_-_Notes.pdf
22PH102_ISE_U2_LP1_-_Notes.pdf
 
19IS303_22-23_LM11.pdf
19IS303_22-23_LM11.pdf19IS303_22-23_LM11.pdf
19IS303_22-23_LM11.pdf
 
19IS305_U2_LP4_LM4-22-23.pdf
19IS305_U2_LP4_LM4-22-23.pdf19IS305_U2_LP4_LM4-22-23.pdf
19IS305_U2_LP4_LM4-22-23.pdf
 
19IS305_U1_LP3_LM3-22-23-2.pdf
19IS305_U1_LP3_LM3-22-23-2.pdf19IS305_U1_LP3_LM3-22-23-2.pdf
19IS305_U1_LP3_LM3-22-23-2.pdf
 
An Internet of Things Based Smart Waste.pptx
An Internet of Things Based Smart Waste.pptxAn Internet of Things Based Smart Waste.pptx
An Internet of Things Based Smart Waste.pptx
 

Último

8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 

Último (20)

8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 

19IS402_LP3.1_LM_22-23.pdf

  • 1. IMPORTANT PROBLEM TYPES 19IS402 – DESIGN AND ANALYSIS OF ALGORITHMS
  • 2. TOPICS TO BE COVERED ● Sorting ● Searching ● String processing (e.g. string matching) ● Graph problems (e.g. graph coloring problem) ● Combinatorial problems (e.g. maximizes a cost) ● Geometric problems (e.g. convex hull problem) ● Numerical problems (e.g. solving equations )
  • 4. SORTING ● The sorting problem is to rearrange the items of a given list in nondecreasing (ascending) order ● Sorting can be done on numbers, characters, strings or records ● Example: To sort student records in alphabetical order of names or by student number or by student grade-point average. Such a specially chosen piece of information is called a key Sorting classification: 1. stable sorting - preserve the relative order of equal elements 2. unstable sorting - Doesn’t preserve the relative order of equal elements
  • 7. IN-PLACE AND OUT OF PLACE SORTING In-Place Sorting : ● Algorithm directly modifies the list that is received as input instead of creating a new list that is then modified ● In-place sorting uses small amount of extra space to manipulate the input set ● In other Words, the output is placed in the correct position while the algorithm is still executing, which means that the input will be overwritten by the desired output on run-time ● In-Place, Sorting Algorithm updates input only through replacement or swapping of elements ● An algorithm which is not in-place is sometimes called not-in-Place or out of Place
  • 8. TYPES OF SORTING 1. Bubble sort, insertion sort, and selection sort are in-place sorting algorithms Because only swapping of the element in the input array is required 2. Bubble sort and insertion sort can be applying as stable algorithms but selection sort cannot 3. Merge sort is a stable algorithm but not an in-place algorithm. It requires extra array storage 4. Quicksort is not stable but is an in-place algorithm 5. Heap sort is an in-place algorithm but is not stable
  • 9. BUBBLE SORT AND INSERTION SORT - STABLE ALGORITHM
  • 10. QUICK SORT & MERGE SORT
  • 11. QUICK SORT - NOT STABLEALGORITHM
  • 12. SEARCHING The searching problem deals with finding a given value, called a search key, in a given set. Types : 1. Linear search a. Finding an element within a list. b. It sequentially checks each element of the list until a match is found or the whole list has been searched 2. Binary search a. Finding an item from a sorted list of items b. It works by repeatedly dividing in half the portion of the list that could contain the item
  • 15. STRING PROCESSING ● Astring is a sequence of characters from an alphabet ● Strings comprise letters, numbers, and special characters; bit strings, which comprise zeros and ones; and gene sequences, which can be modeled by strings of characters from the four character alphabet {A, C, G, T}. ● It is very useful in bioinformatics ● Searching for a given word in a text is called string matching
  • 17. GRAPH PROBLEM Graph problems: Agraph is a collection of points called vertices, some of which are connected by line segments called edges Examples: 1. Graph traversal 2. Shortest path algorithm 3. Topological sort 4. Traveling salesman problem 5. Graph-coloring problem and so on
  • 18. COMBINATORIAL PROBLEMS • combination, or a subset that satisfies certain constraints ● Adesired combinatorial object may also be required to have some additional property such s a maximum value or a minimum cost. ● In practical, the combinatorial problems are the most difficult problems in computing. • Example : 1. The traveling salesman problem 2. The graph coloring problem ● Combinatorial problems :To find a combinatorial object such as a permutation, a
  • 19. GEOMETRICAL PROBLEMS Geometric problems: ● Geometric algorithms deal with geometric objects such as points, lines, and polygons ● Geometric algorithms are used in computer graphics, robotics, and tomography Examples : 1. The closest-pair problem 2. The convex-hull problem