File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
/* *
2
2
* \file
3
- * \brief [Linear search
4
- * algorithm](https://en.wikipedia.org/wiki/Linear_search)
3
+ * \brief [Linear search algorithm]
4
+ * Linear search algorithm is based on traversing the the list element one by one, until you find your target element.
5
+ * It is also known as sequential search.
6
+
7
+ Time complexity: O(n)
8
+ * Worst case: O(n) (Worst case will be : the last element is the target element)
9
+ * Best Case: O(1) (The best case will be: the first element is the target element )
10
+
11
+ Space complexity: O(1)
12
+ * Worst case: O(1)
13
+ * Best Case: O(1)
14
+
15
+ * (https://en.wikipedia.org/wiki/Linear_search)
5
16
*
6
17
* @author Unknown author
7
18
* @author [Ritika Mukherjee](https://github.com/ritikaa17)
You can’t perform that action at this time.
0 commit comments