SlideShare uma empresa Scribd logo
1 de 19
CS702
ADVANCED
ALGORITHMS ANALYSIS
AND DESIGN
MUHAMMAD JIBREEL SAMMAR
ID:(MS210400019)
MY TOPIC
SEARCHING
ALGORITHMS AND
THEIR EFFICIENCY,
CONSIDERING TIME
COMPLEXITY
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
•Searching algorithms is a basic, fundamental
step in computing done via step-by-step method
to locate a specific data among a collection of
data.
•any algorithm which solves the search problem,
namely, to retrieve information stored within
some data structure, or calculated in the search
space of a problem domain, either with discrete
or continuous values.
•Searching Algorithms are designed to check
or retrieve an element from any data
structure where it is being stored.
Define: Searching
algorithms?
algorithms are mainly classified in 2 categories according to
their type of search operations
. sequential search in this, the list or array is traversed
sequentially and every element is checked.
• interval search these algorithms are specifically designed for
searching in sorted data-structures. these type of searching algorithms
are more efficient than linear search method.
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
• LINEAR SEARCH
• BINARY SEARCH
• JUMP SEARCH
• INTERPOLATION SEARCH
• EXPONENTIAL SEARCH
• SUBLIST SEARCH (SEARCH A LINKED LIST IN
ANOTHER LIST)
• FIBONACCI SEARCH
• THE UBIQUITOUS BINARY SEARCH
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
Types of Searching Algorithms
Linear Search:
•A linear search or sequential search is a method
for finding an element within a list. This type
of searching algorithms sequentially checks
each element of the list until a match is found or
the whole list has been searched.
•The time complexity
algorithm is O(n)
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
Binary Search:
•This type of searching algorithms is used to
find the position of a specific value contained
in a sorted array.
•Binary search algorithm works on the
principle of divide & conquer and it is
considered the best searching algorithms
because of its faster speed to search (
Provided the data is in sorted form).
•A binary search is also known as a half-
interval search or logarithmic search.
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
•Binary Search:
•Binary Search Tree, is a node-based binary tree
data structure which has the following properties.
•The left subtree of a node contains only nodes
with keys lesser than the node’s key.
•The right subtree of a node contains only nodes
with keys greater than the node’s key.
•The left and right subtree each must also be a
binary search tree. There must be no duplicate
nodes.
•The time complexity of the binary search
algorithm is O(log n)
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
Jump Search:
•just like Binary Search, Jump Search is one
of the searching algorithms for sorted
arrays.
•The basic idea is to check fewer elements
(than linear search) by jumping ahead by fixed
steps or skipping some elements in place of
searching all elements.
•Time Complexity : O(√n)
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
INTERPOLATION SEARCH:
• interpolation search is that type of searching algorithms, used for
searching for a key in an array that has been ordered by numerical
values assigned to the keys ( key ,values ).
• algorithm to work properly, the data collection should be in a sorted
form and equally distributed
interpolation algorithm the same except the above partition logic.
step1: in a loop step3: if the item is less than arr[pos]
step2: if it is a match step4: repeat until a match
• time complexity: if elements are uniformly distributed, then O (log
log n)). in worst case it can take upto o(n).
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
• EXPONENTIAL SEARCH:
• exponential search is also known as doubling or
galloping search. this mechanism is used to find the
range where the search key may present.
• if l and u are the upper and lower bound of the list,
then l and u both are the power of 2. for the last
section, the u is the last position of the list. for that
reason, it is known as exponential.
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
EXPONENTIAL SEARCH INVOLVES 2 BASIC STEPS:
• find range where element is present
• do binary search in above found range.
• TIME COMPLEXITY : O(log N)
applications of exponential search:
• exponential binary search is particularly useful for
unbounded searches, where size of array is infinite.
• it works better than binary search for bounded arrays,
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
Sublist Search:
sublist search is used to detect a presence
of one list in another list. suppose we have
a single-node list (let’s say the first list),
and we want to ensure that the list is
present in another list (let’s say the second
list), then we can perform the sublist
search to find it.
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
Fibonacci Search:
fibonacci search technique is a method of searching
algorithms where a sorted array uses a divide and
conquer algorithm that narrows down possible
locations with the aid of fibonacci numbers.
• compared to binary search where the sorted array is
divided into two equal-sized parts, one of which is
examined further, fibonacci search divides the array
into two parts that have sizes that are
consecutive fibonacci numbers
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
Fibonacci Search:
• fibonacci search is a comparison-based technique
that uses fibonacci numbers to search an element
in a sorted array.
• similarities with binary search:
• works for sorted arrays
• a divide and conquer algorithm.
• has log n time complexity
• for range elimination, and hence for the o(log(n))
complexity
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
The Ubiquitous Binary Search:
problem statement: given a sorted array of n
distinct elements. find a key in the array using
least number of comparisons.
Theoretically we need log N + 1 comparisons in
worst case. If we observe, we are using two
comparisons per iteration except during final
successful match, if any
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
SEARCHING ALGORITHMS AND THEIR
EFFICIENCY
THANKS

Mais conteúdo relacionado

Semelhante a cs702 ppt.ppt

data_structure_Chapter two_computer.pptx
data_structure_Chapter two_computer.pptxdata_structure_Chapter two_computer.pptx
data_structure_Chapter two_computer.pptxMohammed472103
 
Data structure and algorithms
Data structure and algorithmsData structure and algorithms
Data structure and algorithmstechnologygyan
 
Algorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptxAlgorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptxAftabali702240
 
searching techniques.pptx
searching techniques.pptxsearching techniques.pptx
searching techniques.pptxDr.Shweta
 
Alogorithm ppr slideshow
Alogorithm ppr slideshowAlogorithm ppr slideshow
Alogorithm ppr slideshowKartikAgarwal82
 
unit II_2_i.pptx
unit II_2_i.pptxunit II_2_i.pptx
unit II_2_i.pptxHODElex
 
Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And AlgorithmSearching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm03446940736
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxprakashvs7
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingThenmozhiK5
 
Binary Search.pptx
Binary Search.pptxBinary Search.pptx
Binary Search.pptxSheherBano57
 
Data Structures and Algorithm - Week 9 - Search Algorithms
Data Structures and Algorithm - Week 9 - Search AlgorithmsData Structures and Algorithm - Week 9 - Search Algorithms
Data Structures and Algorithm - Week 9 - Search AlgorithmsFerdin Joe John Joseph PhD
 
4.1 sequentioal search
4.1 sequentioal search4.1 sequentioal search
4.1 sequentioal searchKrish_ver2
 

Semelhante a cs702 ppt.ppt (20)

data_structure_Chapter two_computer.pptx
data_structure_Chapter two_computer.pptxdata_structure_Chapter two_computer.pptx
data_structure_Chapter two_computer.pptx
 
Data structure and algorithms
Data structure and algorithmsData structure and algorithms
Data structure and algorithms
 
Algorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptxAlgorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptx
 
searching techniques.pptx
searching techniques.pptxsearching techniques.pptx
searching techniques.pptx
 
Alogorithm ppr slideshow
Alogorithm ppr slideshowAlogorithm ppr slideshow
Alogorithm ppr slideshow
 
Analysis of Algorithm - Binary Search.pptx
Analysis of Algorithm - Binary Search.pptxAnalysis of Algorithm - Binary Search.pptx
Analysis of Algorithm - Binary Search.pptx
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
 
Searching
SearchingSearching
Searching
 
unit II_2_i.pptx
unit II_2_i.pptxunit II_2_i.pptx
unit II_2_i.pptx
 
Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And AlgorithmSearching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptx
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & Searching
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
Presentation
PresentationPresentation
Presentation
 
Binary Search.pptx
Binary Search.pptxBinary Search.pptx
Binary Search.pptx
 
SearchAlgorithm.pdf
SearchAlgorithm.pdfSearchAlgorithm.pdf
SearchAlgorithm.pdf
 
Search methods
Search methodsSearch methods
Search methods
 
Data Structures and Algorithm - Week 9 - Search Algorithms
Data Structures and Algorithm - Week 9 - Search AlgorithmsData Structures and Algorithm - Week 9 - Search Algorithms
Data Structures and Algorithm - Week 9 - Search Algorithms
 
4.1 sequentioal search
4.1 sequentioal search4.1 sequentioal search
4.1 sequentioal search
 
data science
data sciencedata science
data science
 

Último

NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home ServiceSapana Sha
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectBoston Institute of Analytics
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanMYRABACSAFRA2
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfchwongval
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 

Último (20)

NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis Project
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population Mean
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdf
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 

cs702 ppt.ppt

  • 1.
  • 3. MY TOPIC SEARCHING ALGORITHMS AND THEIR EFFICIENCY, CONSIDERING TIME COMPLEXITY
  • 4. SEARCHING ALGORITHMS AND THEIR EFFICIENCY •Searching algorithms is a basic, fundamental step in computing done via step-by-step method to locate a specific data among a collection of data. •any algorithm which solves the search problem, namely, to retrieve information stored within some data structure, or calculated in the search space of a problem domain, either with discrete or continuous values. •Searching Algorithms are designed to check or retrieve an element from any data structure where it is being stored. Define: Searching algorithms?
  • 5. algorithms are mainly classified in 2 categories according to their type of search operations . sequential search in this, the list or array is traversed sequentially and every element is checked. • interval search these algorithms are specifically designed for searching in sorted data-structures. these type of searching algorithms are more efficient than linear search method. SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 6. • LINEAR SEARCH • BINARY SEARCH • JUMP SEARCH • INTERPOLATION SEARCH • EXPONENTIAL SEARCH • SUBLIST SEARCH (SEARCH A LINKED LIST IN ANOTHER LIST) • FIBONACCI SEARCH • THE UBIQUITOUS BINARY SEARCH SEARCHING ALGORITHMS AND THEIR EFFICIENCY Types of Searching Algorithms
  • 7. Linear Search: •A linear search or sequential search is a method for finding an element within a list. This type of searching algorithms sequentially checks each element of the list until a match is found or the whole list has been searched. •The time complexity algorithm is O(n) SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 8. Binary Search: •This type of searching algorithms is used to find the position of a specific value contained in a sorted array. •Binary search algorithm works on the principle of divide & conquer and it is considered the best searching algorithms because of its faster speed to search ( Provided the data is in sorted form). •A binary search is also known as a half- interval search or logarithmic search. SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 9. •Binary Search: •Binary Search Tree, is a node-based binary tree data structure which has the following properties. •The left subtree of a node contains only nodes with keys lesser than the node’s key. •The right subtree of a node contains only nodes with keys greater than the node’s key. •The left and right subtree each must also be a binary search tree. There must be no duplicate nodes. •The time complexity of the binary search algorithm is O(log n) SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 10. Jump Search: •just like Binary Search, Jump Search is one of the searching algorithms for sorted arrays. •The basic idea is to check fewer elements (than linear search) by jumping ahead by fixed steps or skipping some elements in place of searching all elements. •Time Complexity : O(√n) SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 11. INTERPOLATION SEARCH: • interpolation search is that type of searching algorithms, used for searching for a key in an array that has been ordered by numerical values assigned to the keys ( key ,values ). • algorithm to work properly, the data collection should be in a sorted form and equally distributed interpolation algorithm the same except the above partition logic. step1: in a loop step3: if the item is less than arr[pos] step2: if it is a match step4: repeat until a match • time complexity: if elements are uniformly distributed, then O (log log n)). in worst case it can take upto o(n). SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 12. • EXPONENTIAL SEARCH: • exponential search is also known as doubling or galloping search. this mechanism is used to find the range where the search key may present. • if l and u are the upper and lower bound of the list, then l and u both are the power of 2. for the last section, the u is the last position of the list. for that reason, it is known as exponential. SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 13. EXPONENTIAL SEARCH INVOLVES 2 BASIC STEPS: • find range where element is present • do binary search in above found range. • TIME COMPLEXITY : O(log N) applications of exponential search: • exponential binary search is particularly useful for unbounded searches, where size of array is infinite. • it works better than binary search for bounded arrays, SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 14. Sublist Search: sublist search is used to detect a presence of one list in another list. suppose we have a single-node list (let’s say the first list), and we want to ensure that the list is present in another list (let’s say the second list), then we can perform the sublist search to find it. SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 15. Fibonacci Search: fibonacci search technique is a method of searching algorithms where a sorted array uses a divide and conquer algorithm that narrows down possible locations with the aid of fibonacci numbers. • compared to binary search where the sorted array is divided into two equal-sized parts, one of which is examined further, fibonacci search divides the array into two parts that have sizes that are consecutive fibonacci numbers SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 16. Fibonacci Search: • fibonacci search is a comparison-based technique that uses fibonacci numbers to search an element in a sorted array. • similarities with binary search: • works for sorted arrays • a divide and conquer algorithm. • has log n time complexity • for range elimination, and hence for the o(log(n)) complexity SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 17. The Ubiquitous Binary Search: problem statement: given a sorted array of n distinct elements. find a key in the array using least number of comparisons. Theoretically we need log N + 1 comparisons in worst case. If we observe, we are using two comparisons per iteration except during final successful match, if any SEARCHING ALGORITHMS AND THEIR EFFICIENCY
  • 18. SEARCHING ALGORITHMS AND THEIR EFFICIENCY