SlideShare a Scribd company logo
1 of 11
GRAPHIC ERA
HILL
UNIVERSITY
Presentation On
Searching
•Linear Search
•Binary Search
Searching
Searching is a process of finding an
element within the list of elements
stored in any order or randomly.
Linear search and binary search are
the two methods which are used in
arrays for searching the elements.
Linear Search
A linear search scans one item at a time,
without jumping to any item .
• The worst case complexity is O(n),
sometimes known an O(n) search
• Time taken to search elements keep
increasing as the number of elements
are increased.
Advantage of Linear Search
The primary advantage of linear search is its
simplicity: conceptually, it's extraordinarily easy
to understand, and, implementation-wise, it's
also very straight-forward. From an operational
standpoint, linear search also is very resource
efficient - it does not require copying /
partitioning of the array being search, and thus is
memory-efficient. It also operates equally well
on both unsorted and sorted data.
Disadvantage of Linear Search
The primary disadvantage of linear search
is that it has a very poor O(n) general
efficiency. That is, the performance of the
algorithm scales linearly with the size of the
input. For the general case, linear search
thus is considerably slower than many
other search algorithms.
Binary Search
A binary search however, cut down your
search to half as soon as you find middle
of a sorted list.
• The middle element is looked to check
if it is greater than or less than the
value to be searched.
• Accordingly, search is done to either
half of the given list
Advantage of binary search
•It’s a fairly simple algorithm, though
people get it wrong all the time.
•It’s well known and often implemented
for you as a library routine.
•Binary search is an optimal searching
algorithm using which we can search
desired element very efficiently .
Disadvantages of binary search
• It’s more complicated than linear search, and
is overkill for very small numbers of elements.
• It works only on lists that are sorted and kept
sorted.
• It works only on element types for which
there exists a less-than relationship. Some
types simply cannot be sorted
Applications
• The Binary Search is an efficient searching
method and is used to search desired record
from database.
• For solving non-linear equation, with one
unknown, this method is used.
Amitdsppt

More Related Content

Similar to Amitdsppt

Linear Search for design and analysis of algorithm
Linear Search for design and analysis of algorithmLinear Search for design and analysis of algorithm
Linear Search for design and analysis of algorithm
JavedKhan524377
 
Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operations
babuk110
 
Data Structure - Complete Basic Overview.ppt
Data Structure - Complete Basic Overview.pptData Structure - Complete Basic Overview.ppt
Data Structure - Complete Basic Overview.ppt
ak8820
 
Search enabled applications with lucene.net
Search enabled applications with lucene.netSearch enabled applications with lucene.net
Search enabled applications with lucene.net
Willem Meints
 

Similar to Amitdsppt (20)

CPP12 - Algorithms
CPP12 - AlgorithmsCPP12 - Algorithms
CPP12 - Algorithms
 
Database Engine
Database EngineDatabase Engine
Database Engine
 
Linear Search for design and analysis of algorithm
Linear Search for design and analysis of algorithmLinear Search for design and analysis of algorithm
Linear Search for design and analysis of algorithm
 
Binary Search.pptx
Binary Search.pptxBinary Search.pptx
Binary Search.pptx
 
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
 
Searching, Sorting and Hashing Techniques
Searching, Sorting and Hashing TechniquesSearching, Sorting and Hashing Techniques
Searching, Sorting and Hashing Techniques
 
Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operations
 
Data structure and algorithms
Data structure and algorithmsData structure and algorithms
Data structure and algorithms
 
Binary search algorithm.pptx
Binary search  algorithm.pptxBinary search  algorithm.pptx
Binary search algorithm.pptx
 
Sorting And Type of Sorting
Sorting And Type of SortingSorting And Type of Sorting
Sorting And Type of Sorting
 
Binary search
Binary searchBinary search
Binary search
 
SORTING techniques.pptx
SORTING techniques.pptxSORTING techniques.pptx
SORTING techniques.pptx
 
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 - Complete Basic Overview.ppt
Data Structure - Complete Basic Overview.pptData Structure - Complete Basic Overview.ppt
Data Structure - Complete Basic Overview.ppt
 
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
 
Searching,sorting
Searching,sortingSearching,sorting
Searching,sorting
 
Data operatons & searching and sorting algorithms
Data operatons & searching and sorting algorithmsData operatons & searching and sorting algorithms
Data operatons & searching and sorting algorithms
 
Rahat & juhith
Rahat & juhithRahat & juhith
Rahat & juhith
 
Binary Search Tree In Python.pptx
Binary Search Tree In Python.pptxBinary Search Tree In Python.pptx
Binary Search Tree In Python.pptx
 
Search enabled applications with lucene.net
Search enabled applications with lucene.netSearch enabled applications with lucene.net
Search enabled applications with lucene.net
 

Recently uploaded

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
Muhammad Subhan
 

Recently uploaded (20)

ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 

Amitdsppt

  • 3. Searching Searching is a process of finding an element within the list of elements stored in any order or randomly. Linear search and binary search are the two methods which are used in arrays for searching the elements.
  • 4. Linear Search A linear search scans one item at a time, without jumping to any item . • The worst case complexity is O(n), sometimes known an O(n) search • Time taken to search elements keep increasing as the number of elements are increased.
  • 5. Advantage of Linear Search The primary advantage of linear search is its simplicity: conceptually, it's extraordinarily easy to understand, and, implementation-wise, it's also very straight-forward. From an operational standpoint, linear search also is very resource efficient - it does not require copying / partitioning of the array being search, and thus is memory-efficient. It also operates equally well on both unsorted and sorted data.
  • 6. Disadvantage of Linear Search The primary disadvantage of linear search is that it has a very poor O(n) general efficiency. That is, the performance of the algorithm scales linearly with the size of the input. For the general case, linear search thus is considerably slower than many other search algorithms.
  • 7. Binary Search A binary search however, cut down your search to half as soon as you find middle of a sorted list. • The middle element is looked to check if it is greater than or less than the value to be searched. • Accordingly, search is done to either half of the given list
  • 8. Advantage of binary search •It’s a fairly simple algorithm, though people get it wrong all the time. •It’s well known and often implemented for you as a library routine. •Binary search is an optimal searching algorithm using which we can search desired element very efficiently .
  • 9. Disadvantages of binary search • It’s more complicated than linear search, and is overkill for very small numbers of elements. • It works only on lists that are sorted and kept sorted. • It works only on element types for which there exists a less-than relationship. Some types simply cannot be sorted
  • 10. Applications • The Binary Search is an efficient searching method and is used to search desired record from database. • For solving non-linear equation, with one unknown, this method is used.