Searching: Searching means finding an element from an array. It refers to the process of finding the location of a given data element from an array. For example: If you want to work on your computer notebook, you have to search for it for yourself. You can do searching by two methods:
1. Sequential Search: This search is also known as linear search because in this method to search an element from data source one has to compare particular data item with the first element than the second element and so on until the search is completed. Because of this sequential approach, it is known as sequential search. In this, if the element is found in the middle, search process terminates.
2. Binary Search: In this method of searching, only sorted data can be used, unsorted data cannot be used to apply this type of search. To do searching in Binary method, the sorted data is divided into two parts and the particular element is compared with the middle element. If found greater, the first and that middle element is divided into two parts and their middle element is compared. And if found smaller, the middle and the last element is divided into two parts and their middle element is compared. This process goes on until the search is completed. This method of search is quick and saves time. It is also known as Random search.