SlideShare a Scribd company logo
Sequential and Parallel Searching
Algorithms
Presented By
Nishant Mahat 074MSCSK006
Rachana Kunwar 074MSCSK009
Suresh Mainali 074MSCSK014
Suresh Pokharel 074MSCSK015
(Msc. In Computer System and Knowledge Engineering, Pulchowk Campus )
Introduction
● Parallel search or multithreaded search is a way to increase search speed by
using additional processors.
● Parallel search algorithms are classified by their scalability (that means the
behavior of the algorithm as the number of processors become large) and their
speed up.
● The speed up is defined as the ratio of the running time of the sequential
execution to the running time of the parallel execution.
● Speed up acts as an indicator for a parallel program’s performance.
Sequential Search Algorithms
The search starts at the first record and
moves through each record until a match is
made, or not made.
Time complexity: O(n), ie. grows linearly as
the no. of items increases
int arraySize = arr.length;
for(int i = 0; i < arraySize; i++) {
if(arr[i] == key) {
return i;
}
}
return -1;
Sequential vs. Parallel Searching
Example: Sequential Bubble Sort
● Compares two consecutive values at a time and swaps them if they are out of
order.
● Greater values are being moved towards the end of the list.
● Number of comparisons and swaps:
which corresponds to a time complexity O(n2
)
Example: Sequential Bubble Sort
Sequential Parallel Search Algorithm
Input:- An unsorted array S and
the search element y
Output:- The position of y
The unsorted array is first decomposed into
n/p subarrays.
Complexity: O(log(n+1)/log(p+1))
for k = 0 to n-2
if k is even then
for i = 0 to (n/2)-1 do in parallel
If A[2i] > A[2i+1] then
Exchange A[2i] ↔ A[2i+1]
else
for i = 0 to (n/2)-2 do in parallel
If A[2i+1] > A[2i+2] then
Exchange A[2i+1] ↔ A[2i+2]
Example: Parallel Bubble Sort
The basic idea is to run multiple iterations in parallel.
Operates in two alternate phases:
Phase-even:
Even processes exchange values
with right neighbors.
Phase-odd:
Odd processes exchange values
with right neighbors.
References
● http://nptel.ac.in/courses/106106112/Module5/Lecture%202/Lecture%202.pdf
[Searching on a random sequence in parallel]
● https://researchgate.net/publication/267739792_High_Performance_Pattern_
Matching_on_Heterogeneous_Platform [High Performance Pattern Matching on
Heterogeneous Platform]
Ad

More Related Content

What's hot (20)

A greedy algorithms
A greedy algorithmsA greedy algorithms
A greedy algorithms
Amit Kumar Rathi
 
Bubble sort | Data structure |
Bubble sort | Data structure |Bubble sort | Data structure |
Bubble sort | Data structure |
MdSaiful14
 
Algorithm: Quick-Sort
Algorithm: Quick-SortAlgorithm: Quick-Sort
Algorithm: Quick-Sort
Tareq Hasan
 
Merge sort and quick sort
Merge sort and quick sortMerge sort and quick sort
Merge sort and quick sort
Shakila Mahjabin
 
Unit 1 polynomial manipulation
Unit 1   polynomial manipulationUnit 1   polynomial manipulation
Unit 1 polynomial manipulation
LavanyaJ28
 
Parallel sorting Algorithms
Parallel  sorting AlgorithmsParallel  sorting Algorithms
Parallel sorting Algorithms
GARIMA SHAKYA
 
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
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed Computing
Richa Singh
 
Association rules apriori algorithm
Association rules   apriori algorithmAssociation rules   apriori algorithm
Association rules apriori algorithm
Dr. Jasmine Beulah Gnanadurai
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
Waqar Akram
 
Quicksort Presentation
Quicksort PresentationQuicksort Presentation
Quicksort Presentation
irdginfo
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
Amrinder Arora
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
Rezwan Siam
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
Convex hull
Convex hullConvex hull
Convex hull
Shiwangi Thakur
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
Md. Shafiuzzaman Hira
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
Mohamed Loey
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Swapnil Agrawal
 
Complexity analysis in Algorithms
Complexity analysis in AlgorithmsComplexity analysis in Algorithms
Complexity analysis in Algorithms
Daffodil International University
 
Allocation of Frames & Thrashing
Allocation of Frames & ThrashingAllocation of Frames & Thrashing
Allocation of Frames & Thrashing
arifmollick8578
 
Bubble sort | Data structure |
Bubble sort | Data structure |Bubble sort | Data structure |
Bubble sort | Data structure |
MdSaiful14
 
Algorithm: Quick-Sort
Algorithm: Quick-SortAlgorithm: Quick-Sort
Algorithm: Quick-Sort
Tareq Hasan
 
Unit 1 polynomial manipulation
Unit 1   polynomial manipulationUnit 1   polynomial manipulation
Unit 1 polynomial manipulation
LavanyaJ28
 
Parallel sorting Algorithms
Parallel  sorting AlgorithmsParallel  sorting Algorithms
Parallel sorting Algorithms
GARIMA SHAKYA
 
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
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed Computing
Richa Singh
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
Waqar Akram
 
Quicksort Presentation
Quicksort PresentationQuicksort Presentation
Quicksort Presentation
irdginfo
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
Amrinder Arora
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
Rezwan Siam
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
Mohamed Loey
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Swapnil Agrawal
 
Allocation of Frames & Thrashing
Allocation of Frames & ThrashingAllocation of Frames & Thrashing
Allocation of Frames & Thrashing
arifmollick8578
 

Similar to Sequential and Parallel Searching Algorithms (20)

Computational Complexity.pptx
Computational Complexity.pptxComputational Complexity.pptx
Computational Complexity.pptx
EnosSalar
 
Parallel sorting algorithm
Parallel sorting algorithmParallel sorting algorithm
Parallel sorting algorithm
Richa Kumari
 
Data Structure (MC501)
Data Structure (MC501)Data Structure (MC501)
Data Structure (MC501)
Kamal Singh Lodhi
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Julie Iskander
 
Data structures
Data structuresData structures
Data structures
Edward Blurock
 
L1803016468
L1803016468L1803016468
L1803016468
IOSR Journals
 
sorting
sortingsorting
sorting
Ravirajsinh Chauhan
 
Searching.pptx
Searching.pptxSearching.pptx
Searching.pptx
VenkataRaoS1
 
Searching Algorithms
Searching AlgorithmsSearching Algorithms
Searching Algorithms
Afaq Mansoor Khan
 
Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0
BG Java EE Course
 
Unit 2 Modeling of Programs A function maps inputs to out.docx
Unit 2 Modeling of Programs A function maps inputs to out.docxUnit 2 Modeling of Programs A function maps inputs to out.docx
Unit 2 Modeling of Programs A function maps inputs to out.docx
dickonsondorris
 
Alternate Sort
Alternate SortAlternate Sort
Alternate Sort
IOSR Journals
 
Lec 03 - Sorting.pptx
Lec 03 - Sorting.pptxLec 03 - Sorting.pptx
Lec 03 - Sorting.pptx
Dr. Shaukat Wasi
 
Sorting and Searching Techniques
Sorting and Searching TechniquesSorting and Searching Techniques
Sorting and Searching Techniques
Prof Ansari
 
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
Tosin Amuda
 
Data Structures 6
Data Structures 6Data Structures 6
Data Structures 6
Dr.Umadevi V
 
design and analysis of algorithm basic concepts.pdf
design and analysis of algorithm basic concepts.pdfdesign and analysis of algorithm basic concepts.pdf
design and analysis of algorithm basic concepts.pdf
mohsinsway1
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
vital vital
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
vital vital
 
Insersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in AlgoritmInsersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in Algoritm
Ehsan Ehrari
 
Computational Complexity.pptx
Computational Complexity.pptxComputational Complexity.pptx
Computational Complexity.pptx
EnosSalar
 
Parallel sorting algorithm
Parallel sorting algorithmParallel sorting algorithm
Parallel sorting algorithm
Richa Kumari
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Julie Iskander
 
Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0
BG Java EE Course
 
Unit 2 Modeling of Programs A function maps inputs to out.docx
Unit 2 Modeling of Programs A function maps inputs to out.docxUnit 2 Modeling of Programs A function maps inputs to out.docx
Unit 2 Modeling of Programs A function maps inputs to out.docx
dickonsondorris
 
Sorting and Searching Techniques
Sorting and Searching TechniquesSorting and Searching Techniques
Sorting and Searching Techniques
Prof Ansari
 
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
Tosin Amuda
 
design and analysis of algorithm basic concepts.pdf
design and analysis of algorithm basic concepts.pdfdesign and analysis of algorithm basic concepts.pdf
design and analysis of algorithm basic concepts.pdf
mohsinsway1
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
vital vital
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
vital vital
 
Insersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in AlgoritmInsersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in Algoritm
Ehsan Ehrari
 
Ad

More from Suresh Pokharel (10)

Information System Architecture
Information System ArchitectureInformation System Architecture
Information System Architecture
Suresh Pokharel
 
Application of Knowledge Engineering in Legal Data : A case study of the info...
Application of Knowledge Engineering in Legal Data : A case study of the info...Application of Knowledge Engineering in Legal Data : A case study of the info...
Application of Knowledge Engineering in Legal Data : A case study of the info...
Suresh Pokharel
 
Case Based Reasoning
Case Based ReasoningCase Based Reasoning
Case Based Reasoning
Suresh Pokharel
 
CNN based Handwritten Signature Recognition
CNN based Handwritten Signature RecognitionCNN based Handwritten Signature Recognition
CNN based Handwritten Signature Recognition
Suresh Pokharel
 
Comparison of ANN Algorithm for Water Quality Prediction of River Ganga
Comparison of ANN Algorithm for Water Quality Prediction of River GangaComparison of ANN Algorithm for Water Quality Prediction of River Ganga
Comparison of ANN Algorithm for Water Quality Prediction of River Ganga
Suresh Pokharel
 
Study of Vitellogenin Motif
Study of Vitellogenin MotifStudy of Vitellogenin Motif
Study of Vitellogenin Motif
Suresh Pokharel
 
Task programming in cloud computing
Task programming in cloud computingTask programming in cloud computing
Task programming in cloud computing
Suresh Pokharel
 
Gene Identification in Alzheimer Disease Using Bioinformatics Analysis
Gene Identification in Alzheimer Disease Using Bioinformatics AnalysisGene Identification in Alzheimer Disease Using Bioinformatics Analysis
Gene Identification in Alzheimer Disease Using Bioinformatics Analysis
Suresh Pokharel
 
Conditional Random Fields
Conditional Random FieldsConditional Random Fields
Conditional Random Fields
Suresh Pokharel
 
Principal component analysis and lda
Principal component analysis and ldaPrincipal component analysis and lda
Principal component analysis and lda
Suresh Pokharel
 
Information System Architecture
Information System ArchitectureInformation System Architecture
Information System Architecture
Suresh Pokharel
 
Application of Knowledge Engineering in Legal Data : A case study of the info...
Application of Knowledge Engineering in Legal Data : A case study of the info...Application of Knowledge Engineering in Legal Data : A case study of the info...
Application of Knowledge Engineering in Legal Data : A case study of the info...
Suresh Pokharel
 
CNN based Handwritten Signature Recognition
CNN based Handwritten Signature RecognitionCNN based Handwritten Signature Recognition
CNN based Handwritten Signature Recognition
Suresh Pokharel
 
Comparison of ANN Algorithm for Water Quality Prediction of River Ganga
Comparison of ANN Algorithm for Water Quality Prediction of River GangaComparison of ANN Algorithm for Water Quality Prediction of River Ganga
Comparison of ANN Algorithm for Water Quality Prediction of River Ganga
Suresh Pokharel
 
Study of Vitellogenin Motif
Study of Vitellogenin MotifStudy of Vitellogenin Motif
Study of Vitellogenin Motif
Suresh Pokharel
 
Task programming in cloud computing
Task programming in cloud computingTask programming in cloud computing
Task programming in cloud computing
Suresh Pokharel
 
Gene Identification in Alzheimer Disease Using Bioinformatics Analysis
Gene Identification in Alzheimer Disease Using Bioinformatics AnalysisGene Identification in Alzheimer Disease Using Bioinformatics Analysis
Gene Identification in Alzheimer Disease Using Bioinformatics Analysis
Suresh Pokharel
 
Conditional Random Fields
Conditional Random FieldsConditional Random Fields
Conditional Random Fields
Suresh Pokharel
 
Principal component analysis and lda
Principal component analysis and ldaPrincipal component analysis and lda
Principal component analysis and lda
Suresh Pokharel
 
Ad

Recently uploaded (20)

Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 

Sequential and Parallel Searching Algorithms

  • 1. Sequential and Parallel Searching Algorithms Presented By Nishant Mahat 074MSCSK006 Rachana Kunwar 074MSCSK009 Suresh Mainali 074MSCSK014 Suresh Pokharel 074MSCSK015 (Msc. In Computer System and Knowledge Engineering, Pulchowk Campus )
  • 2. Introduction ● Parallel search or multithreaded search is a way to increase search speed by using additional processors. ● Parallel search algorithms are classified by their scalability (that means the behavior of the algorithm as the number of processors become large) and their speed up. ● The speed up is defined as the ratio of the running time of the sequential execution to the running time of the parallel execution. ● Speed up acts as an indicator for a parallel program’s performance.
  • 3. Sequential Search Algorithms The search starts at the first record and moves through each record until a match is made, or not made. Time complexity: O(n), ie. grows linearly as the no. of items increases int arraySize = arr.length; for(int i = 0; i < arraySize; i++) { if(arr[i] == key) { return i; } } return -1;
  • 5. Example: Sequential Bubble Sort ● Compares two consecutive values at a time and swaps them if they are out of order. ● Greater values are being moved towards the end of the list. ● Number of comparisons and swaps: which corresponds to a time complexity O(n2 )
  • 7. Sequential Parallel Search Algorithm Input:- An unsorted array S and the search element y Output:- The position of y The unsorted array is first decomposed into n/p subarrays. Complexity: O(log(n+1)/log(p+1)) for k = 0 to n-2 if k is even then for i = 0 to (n/2)-1 do in parallel If A[2i] > A[2i+1] then Exchange A[2i] ↔ A[2i+1] else for i = 0 to (n/2)-2 do in parallel If A[2i+1] > A[2i+2] then Exchange A[2i+1] ↔ A[2i+2]
  • 8. Example: Parallel Bubble Sort The basic idea is to run multiple iterations in parallel. Operates in two alternate phases: Phase-even: Even processes exchange values with right neighbors. Phase-odd: Odd processes exchange values with right neighbors.
  • 9. References ● http://nptel.ac.in/courses/106106112/Module5/Lecture%202/Lecture%202.pdf [Searching on a random sequence in parallel] ● https://researchgate.net/publication/267739792_High_Performance_Pattern_ Matching_on_Heterogeneous_Platform [High Performance Pattern Matching on Heterogeneous Platform]