
Searching and Sorting 567
16.2 SEARCHING
Searching is a technique of finding accurate location of an element in the given data list or set of the
elements like an array, list, or trees. For example, consider an array of 10 elements. These data
elements are stored in successive memory locations. We need to search an element from the array.
In the searching operation, if we want to find a particular element says n, the n is compared with
all the elements and when the exact match is found then the search process is terminated. In case,
no such element exists in the array, the entire array is searched.
If the given element is present in the co ...