Where is Linear Searching Used?
By BYJU'S Exam Prep
Updated on: September 12th, 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.
Table of content
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:
- What are the Types of Social Security?
- Which of the Following is a Waterborne Disease?
- Who was the Author of the Book Republic?
- Who was Called as the Napoleon of India?
- Which of the Following Latitudes Passes through India?
- What do you Understand by Stock of Resources?
- Why is Resource Planning Important for a Country like India?