You are viewing a single comment's thread. Return to all comments →
Python3
def insertionSort2(n, arr): for i in range(1, n): if arr[i] < arr[i-1]: if i == n-1: arr = sorted(arr) print(*arr) else: arr[:i+1] = sorted(arr[:i+1]) print(*arr) else: print(*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 →
Python3