DSA for Beginners
Learn more about Searching Algorithms in DSA Self Paced Course
Practice Problems on Searching Algorithms
Top Quizzes on Searching Algorithms
What is Searching Algorithm?
Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored.
Based on the type of search operation, these algorithms are generally classified into two categories:
Sequential Search: In this, the list or array is traversed sequentially and every element is checked. For example: Linear Search.
Linear Search to find the element “20” in a given list of numbers
Interval Search: These algorithms are specifically designed for searching in sorted data-structures. These type of searching algorithms are much more efficient than Linear Search as they repeatedly target the center of the search structure and divide the search space in half. For Example: Binary Search.
Binary Search to find the element “23” in a given list of numbers
- Linear Search
- Sentinel Linear Search
- Binary Search
- Meta Binary Search | One-Sided Binary Search
- Ternary Search
- Jump Search
- Interpolation Search
- Exponential Search
- Fibonacci Search
- The Ubiquitous Binary Search
- Linear Search vs Binary Search
- Interpolation search vs Binary search
- Why is Binary Search preferred over Ternary Search?
- Is Sentinel Linear Search better than normal Linear Search?
Library Implementations of Searching Algorithms :
- Binary Search functions in C++ STL (binary_search, lower_bound and upper_bound)
- Arrays.binarySearch() in Java with examples | Set 1
- Arrays.binarySearch() in Java with examples | Set 2 (Search in subarray)
- Collections.binarySearch() in Java with Examples
Some standard problems on Searching:
- ‘Practice Problems’ on Searching
- ‘Quizzes’ on Searching
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or if you want to share more information about the topic discussed above.