Created
December 30, 2016 05:44
-
-
Save robbie01/c545e7d46913188a4432d7ef6a977277 to your computer and use it in GitHub Desktop.
Timsort implemented in Python 3
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
if __name__ == '__main__': | |
from sys import argv | |
from random import shuffle | |
list = list(range(int(argv[1]))) | |
list.sort() # ;) | |
print(all(list[i] <= list[i+1] for i in range(len(list)-1))) | |
# seriously though timsort is really weird |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment