Skip to content

Commit 202002c

Browse files
committed
added python linear search
1 parent 6f124c7 commit 202002c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def linsearch(arr, n):
2+
for i in range(len(arr)):
3+
if (arr[i]==n):
4+
return i
5+
return -1

0 commit comments

Comments
 (0)