Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
 
PREVIOUS NEXT
Tagged: #linear #search #python
ADD COMMENT
Topic
Name
2+7 =