Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SudhanshuMishra8826 authored Oct 5, 2018
1 parent d08032f commit 87ff559
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions linear_search/Python/linearsearch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
print("************************Linear search*****************************")
arr=list()
n=input("Enter the number of elements : ")
for i in range(int(n)):
ele=int(input("Element : "))
arr.append(int(ele))
key=int(input("Enter the key(elemt to be searched): "))
flag=0
for i in range(int(n)):
if(arr[i]==key):
print("Element Found at ", i+1)
flag=1
if flag==0:
print("Element not found ")
k=input("************************* Press Enter to Exit****************")

0 comments on commit 87ff559

Please sign in to comment.