Searching is the algorithmic process of finding a particular item in a collection of items.
In other words, Searching involves deciding whether a search key is present in the data. For example, looking up a phone book or address book. if we got the phone number then done otherwise continue till the end of the phone book.
Types of Searching Technic in Data Structure:
1. Linear Search
2. Binary Search
Linear Search:
A linear search is the basic and simple search algorithm. A linear search searches an element or value from an array till, the desired element or value is not found in the list. its works on the sequential order. It compares the (search item) element with all the other elements given in the list and if the (search item) element is matched it returns the value True (index) Otherwise it return False. We can also applied Linear Search on the unsorted or unordered list where there are fewer elements in a list.
Binary Search:
Binary Search is applied on the sorted array or list. In binary search, we first compare the value with the elements in the middle position of the array. If the value is matched, then we return the value. If the value is less than the middle element, then it must lie in the left (Lower) half of the array and if it's greater than the element then it must lie in the right (Upper) half of the array. We repeat this procedure on the lower half if First we search on the Left or upper half if First we search on the Right of the array. Binary Search is useful when there are large numbers of elements in an array otherwise Linear Search is Suitable.