Hello, could you please tell me some applications of linear search in arrays ? It will help me in making much more clear image of this algorithm in my mind.
Linear search algorithm
Lets say you want to search for an element (x) in a given array ( arr) . The first and foremost algorithm that would strike a person is to iterate through each element of the array and check whether it is equal to the search element( x ) or not.
Linear search is rarely used practically because other search algorithms such as the binary search algorithm and hash tables allow significantly faster-searching comparison to Linear search.
1 Like
Ok. Thank a lot