You are viewing a single comment's thread. Return to all comments →
Here is the code, as brute as I possible could:
def insertionSort1(n, arr): sortd = sorted(arr) for i in range(-1, -n-1, -1): x = i while arr[i] != sortd[i]: if sortd[x] == sortd[i]: arr[x] = sortd[i] arr[i] = arr[x] [print(str(arr[y]), end=" ") for y in range(n)] print("") x = x - 1
Seems like cookies are disabled on this browser, please enable them to open this website
Insertion Sort - Part 1
You are viewing a single comment's thread. Return to all comments →
Python 3
Here is the code, as brute as I possible could: