You are viewing a single comment's thread. Return to all comments →
def insertion_sort(l): for i in range(1, len(l)): j = i - 1 k = l[i] while l[j] > k and j>=0: l[j+1] = l[j] j-=1 l[j+1] = k
Seems like cookies are disabled on this browser, please enable them to open this website
Correctness and the Loop Invariant
You are viewing a single comment's thread. Return to all comments →