Answers for "serial search in python"

1

linear search python

def linear_search(a, key):
	position = 0
	flag = False
	while position < len(a) and not flag:
		if a[position] == key:
			flag = True
		else:
			position = position + 1
	return flag
Posted by: Guest on February-09-2020

Python Answers by Framework

Browse Popular Code Answers by Language