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