Learn how insertion sort works by placing number cards in order. Move each card into the correct position while keeping the left side sorted. This interactive game helps students understand sorting algorithms step by step.
temp = A[i]
j = i - 1
while j >= 0 and A[j] > temp:
A[j + 1] = A[j]
j--
A[j + 1] = temp