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