Searching is the process of finding the location of a given element in a set of elements. The search is said to be successful if the given element is found i.e., the element does exist in the collection (such as an array); otherwise it is unsuccessful.

Two simple approaches to searching are:

  • Linear search: This method traverses a list sequentially to locate the search key.
  • Binary search: This method works on sorted lists by progressively making better guesses to find the location of a search key.