Skip to content

Instantly share code, notes, and snippets.

@DiegoGallegos4
Last active April 9, 2019 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DiegoGallegos4/2515a0702069386441b424d95ae12705 to your computer and use it in GitHub Desktop.
Save DiegoGallegos4/2515a0702069386441b424d95ae12705 to your computer and use it in GitHub Desktop.
"Divide and Conquer" Linear Search
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