You are viewing a single comment's thread. Return to all comments →
def insertionSort1(n, arr): e=arr[n-1] for i in range(n-2,-1,-1): if arr[i]<e: arr[i+1]=e print(" ".join(str(x) for x in arr)) break else: arr[i+1]=arr[i] print(" ".join(str(x) for x in arr)) else: arr[0]=e print(" ".join(str(x) for x in arr))
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 →