Skip to content

Instantly share code, notes, and snippets.

@manonthemat
Created April 2, 2014 17:32
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 manonthemat/9938961 to your computer and use it in GitHub Desktop.
Save manonthemat/9938961 to your computer and use it in GitHub Desktop.
Example of a simple algorithm with a running time that grows proportional to the input size
def find_max(data):
"""Return the maximum element from a nonempty Python list."""
biggest = data[0]
for val in data:
if val > biggest:
biggest = val
return biggest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment