Sorting algorithms/Insertion sort: Difference between revisions

Content added Content deleted
(Added Arturo implementation)
Line 3,194: Line 3,194:
j = i-1
j = i-1
key = L[i]
key = L[i]
while (L[j] > key) and (j >= 0):
while j >= 0 and L[j] > key:
L[j+1] = L[j]
L[j+1] = L[j]
j -= 1
j -= 1