You are viewing a single comment's thread. Return to all comments →
def insertionSort2(n, arr): for i in range(1, n): j = i - 1 k = arr[i] while arr[j] > k and j >= 0: arr[j+1] = arr[j] j -= 1 arr[j+1] = k print(' '.join(str(i) for i in arr))
Seems like cookies are disabled on this browser, please enable them to open this website
Insertion Sort - Part 2
You are viewing a single comment's thread. Return to all comments →