write the python code for Linear search
Answers
Answered by
2
Answer:
Program
def linear_Search(list1, n, key):
# Searching list1 sequentially.
for i in range(0, n):
if (list1[i] == key):
return i.
return -1.
list1 = [1 ,3, 5, 4, 7, 9]
key = 7.
Explanation:
......
Answered by
4
Answer:
def linear_Search(list1, n, key):
def linear_Search(list1, n, key):# Searching list1 sequentially.
def linear_Search(list1, n, key):# Searching list1 sequentially.for i in range(0, n):
Similar questions
Social Sciences,
2 months ago
Hindi,
2 months ago
Hindi,
2 months ago
Science,
4 months ago
Math,
10 months ago