## Linear Search

There are teo types of searching  are there :-

1)    Linear Search (Sequencil Search)

2)    Binary Search

## Linear Search

For the Searching procedure following possible answer

2.) Return the index of the search element (Searching is Sucessful) in a linear search or the sequesntial search element enter by the and it will compare to first element of the list this comparison process is continue till either element is found or end of the list.

Element List are 5 , 20 , 25, 89 , 90 , 10.

Search Element is 10

I)                   10 == 5

II)                10 == 20

III)              10 == 25

IV)             10 == 89

V)               10 == 90

VI)             10 == 10

Searching successful.

Element present on 6th position.

## Complexity Of Linear search algorithm

• Linear search provide complexity for finding an element in an array because linear search is a step-by-step process, in which specific element is compared with each element of array.
• In linear search complexity is due to two cases.
• It is possible that required element occurs at the end of the array. So linear search consumes more time.
• It is also possible that required element is not present in the given array, this is the worst case.
• In this case the algorithm requires f(n)=n+1 comparisons.
• If the element is at first position in array then only one comparison will be needed