Searching Algorithms Last Updated : 23 Sep, 2025 Suggest changes Share Like Article Like Report Searching algorithms are essential tools in computer science used to locate specific items within a collection of data. In this tutorial, we are mainly going to focus upon searching in an array. When we search an item in an array, there are two most common algorithms used based on the type of input array. Linear Search : It is used for an unsorted array. It mainly does one by one comparison of the item to be search with array elements. It takes linear or O(n) Time.Binary Search : It is used for a sorted array. It mainly compares the array's middle element first and if the middle element is same as input, then it returns. Otherwise it searches in either left half or right half based on comparison result (Whether the mid element is smaller or greater). This algorithm is faster than linear search and takes O(Log n) time.BasicsIntroduction to Searching Two Pointers TechniqueBinary Search Implementationsbinary_search, lower_bound and upper_bound in C++Arrays.binarySearch() in Java Arrays.binarySearch() in Java for Search in subarrayCollections.binarySearch() in JavaBisect in PythonList.BinarySearch in C#Easy ProblemsLargest in an ArraySecond Largest in an array Largest three in an arrayMissing NumberFirst Repeating Missing and RepeatingCount 1’s in a sorted binary array k largest(or smallest) ElementsKth smallest in row and column-wise sorted Common elements in 3 sortedCeiling & Floor in a Sorted Max in a Bitonic More than n/k times Appearing Pair Sum Closest to TargetMedium ProblemsTriplets with zero sumPartition PointLargest pair sumK’th Smallest in Unsorted ArraySearch, Min & Max in a Sorted & Rotated Peak element Fixed Point K Most Frequent WordsK closest elements Closest Pair from two sorted Binary Search for Rationals Missing Element in APHard ProblemsMedian of two sortedMedian of two sorted of different sizesSearch in an almost sorted Search in a sorted infinite Pair sum in a sorted and rotated K’th Smallest/Largest Element in Unsorted K’th largest element in a stream More Searching AlgorithmsSentinel Linear SearchMeta Binary Search | One-Sided Binary SearchTernary SearchJump SearchInterpolation SearchExponential SearchFibonacci Search Best First Search (Informed Search) Comparisons Linear Search vs Binary SearchInterpolation search vs Binary searchWhy is Binary Search preferred over Ternary Search?Is Sentinel Linear Search better than normal Linear Search?Quick Links:‘Practice Problems’ on Searching Top Searching Interview Questions‘Quizzes’ on Searching Learn Data Structure and Algorithms | DSA Tutorial H harendrakumar123 Follow Explore DSA FundamentalsLogic Building Problems 2 min read Analysis of Algorithms 1 min read Data StructuresArray Data Structure 3 min read String in Data Structure 2 min read Hashing in Data Structure 2 min read Linked List Data Structure 2 min read Stack Data Structure 2 min read Queue Data Structure 2 min read Tree Data Structure 2 min read Graph Data Structure 3 min read Trie Data Structure 15+ min read AlgorithmsSearching Algorithms 2 min read Sorting Algorithms 3 min read Introduction to Recursion 14 min read Greedy Algorithms 3 min read Graph Algorithms 3 min read Dynamic Programming or DP 3 min read Bitwise Algorithms 4 min read AdvancedSegment Tree 2 min read Binary Indexed Tree or Fenwick Tree 15 min read Square Root (Sqrt) Decomposition Algorithm 15+ min read Binary Lifting 15+ min read Geometry 2 min read Interview PreparationInterview Corner 3 min read GfG160 3 min read Practice ProblemGeeksforGeeks Practice - Leading Online Coding Platform 6 min read Problem of The Day - Develop the Habit of Coding 5 min read Article Tags : Searching DSA Like