Problem: Given an array arr of n elements, write a function to search a given element x in arr.
Element found at position 1
The time complexity of the above algorithm is O(n).
Please refer complete article on Linear Search for more details!
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Linear Search vs Binary Search
- C/C++ Program for Linear Search
- Java Program for Anagram Substring Search (Or Search for all permutations)
- Linear search using Multi-threading
- Sentinel Linear Search
- Improving Linear Search Technique
- Linear Search
- Interpolation search vs Binary search
- Why is Binary Search preferred over Ternary Search?
- Sublist Search (Search a linked list in another list)
- Repeatedly search an element by doubling it after every successful search
- Meta Binary Search | One-Sided Binary Search
- Best First Search (Informed Search)
- Java Program for Binary Search (Recursive and Iterative)
- Java Program to Search for a File in a Directory
- Java Program to Search an Element in a Linked List
- Java Program to Search an Element in a Circular Linked List
- K'th Smallest/Largest Element in Unsorted Array | Set 2 (Expected Linear Time)
- K'th Smallest/Largest Element in Unsorted Array | Set 3 (Worst Case Linear Time)
- Median of two sorted arrays of different sizes | Set 1 (Linear)