Data Structures and Algorithms Linear Search | Time Complexity | DSA Programming

Published: 13 March 2024
on channel: Prashant Rana
42
5

A Linear Search is the simplest approach employed to search for an element in a data set. It examines each element until it finds a match, starting at the beginning of the data set, until the end. The search is finished and terminated once the target element is located.

Advantages of Linear Search:
Linear search can be used irrespective of whether the array is sorted or not. It can be used on arrays of any data type. Does not require any additional memory. It is a well-suited algorithm for small datasets.

Drawbacks of Linear Search:
Linear search has a time complexity of O(N), which in turn makes it slow for large datasets.Not suitable for large arrays.

When to use Linear Search?
When we are dealing with a small dataset.
When you are searching for a dataset stored in contiguous memory.

#datastructures #dsalgo #algorithm #java #programming


On this page of the site you can watch the video online Data Structures and Algorithms Linear Search | Time Complexity | DSA Programming with a duration of hours minute second in good quality, which was uploaded by the user Prashant Rana 13 March 2024, share the link with friends and acquaintances, this video has already been watched 42 times on youtube and it was liked by 5 viewers. Enjoy your viewing!