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. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
In case you wish to attend live classes with industry experts, please refer DSA Live Classes