Created
December 18, 2021 08:56
-
-
Save Purrrpley/ef9f7071ef308cb1dd6469566f700e94 to your computer and use it in GitHub Desktop.
An O(1) sorting algorithm
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 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