Last active
April 9, 2019 17:48
-
-
Save DiegoGallegos4/2515a0702069386441b424d95ae12705 to your computer and use it in GitHub Desktop.
"Divide and Conquer" Linear Search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def linear_search(A, low, high, key): | |
if high < low: | |
return 'NOT_FOUND' | |
if A[low] == key: | |
return low | |
return linear_search(A, low + 1, high, key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment