Search
Linear Search
Linear Searchlinear search or sequential search is an algorithm that is used to find an element from a list (linked lists or arrays). This algorithm walks through every element of a list until there is a match. Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[].
Input : arr[] = {10, 20, 80, 30, 60, 50,110, 100, 130, 170} x = 110; Output : 6 Element x is present at index 6