Skip to content

Instantly share code, notes, and snippets.

@Purrrpley
Created December 18, 2021 08:56
Show Gist options
  • Save Purrrpley/ef9f7071ef308cb1dd6469566f700e94 to your computer and use it in GitHub Desktop.
Save Purrrpley/ef9f7071ef308cb1dd6469566f700e94 to your computer and use it in GitHub Desktop.
An O(1) sorting algorithm
def assumption_sort(array):
"""An O(1) sorting algorithm
Sorts in O(1) time. Sorts and returns the input array assuming it is already
sorted - if it is not then output of this function is an implementation
detail and is left undefined.
"""
return array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment