StudentSquare.in

Linear Search


Detailed Discussion


1)What is Linear Search ?
  Linear search is a very simple search algorithm where a sequential search is made over all items one by one. Every item is checked and if a match is found then that particular item is returned, otherwise the search continues till the end of the data collection.

2)What is the complexity of Linear Search ?
  Time Complexity of Linear Search Algorithm is O(n).   Here, n is the number of elements in the linear array.

3)Why it is called Sequential Search ?
  As the algorithm traverses the list sequentially to locate the required item in the list, so it is also called as Sequential Search.

4)When Linear Search Algorithm is applied ?
  i) No information is given about the list.
ii)The given list is unsorted or the elements are unordered.
iii)The list of data items is smaller.