hamburger

Where is Linear Searching Used?

By BYJU'S Exam Prep

Updated on: November 9th, 2023

Linear Search is used to find an element in a list where each element of a given list is compared with the item to be searched. The element to be searched for is called a key. Linear search is an exhaustive search technique. This is the most basic and simple search method.

Use of Linear Searching

In linear search, first, each element in the list is compared one by one with the key. The process continues until the searched element is found, and after that, the search is declared successful. In case the searched element is not found, the entire list is traversed and declared an unsuccessful search.

  • Linear Search is also called sequential search or serial search because the items are compared, beginning from the first element of the list and moving toward the last.
  • It is a useful technique for the collection of items that are small in size and not in order.
  • A linear search is the easiest method to search for an element in a data set. Each element of the data set is examined until it finds a match, starting from the beginning to the end of the data set.
  • The search ends and is terminated once the target element is located.
  • If it does not find a match, the algorithm must terminate its execution and return an appropriate result.

Related Questions:

Our Apps Playstore
POPULAR EXAMS
SSC and Bank
Other Exams
GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com
Home Practice Test Series Premium