Created
July 4, 2019 16:37
-
-
Save tuvo1106/13915ef877eea64b83ba5db767be1f46 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 insertion(l: list): | |
arr = l[::] | |
for i in range(len(arr)): | |
for j in range(i, 0, -1): | |
if arr[j] < arr[j - 1]: | |
arr[j], arr[j - 1] = arr[j - 1], arr[j] | |
return arr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment