We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca5b8c1 commit 74ba427Copy full SHA for 74ba427
searches/linear_search.py
@@ -1,4 +1,19 @@
1
"""
2
+Linear Search Algorithm
3
+
4
+Linear search is a simple searching technique that checks each element in the collection
5
+sequentially until the target element is found or the collection is exhausted.
6
+It is also known as sequential search.
7
8
+Characteristics:
9
+- Works on both sorted and unsorted collections
10
+- Time complexity: O(n)
11
+- Space complexity: O(1)
12
+- Simple and reliable for small datasets
13
14
+For large datasets or sorted collections, binary search or other logarithmic search
15
+algorithms are usually more efficient.
16
17
This is pure Python implementation of linear search algorithm
18
19
For doctests run following command:
0 commit comments