Drag and drop the lines into the box on the right. The constructed function should grow the sorted list by one item each iteration. Unlike bubble sort, after the first pass, insertion sort has 'seen' two items, rather than all of them.
Drag from here
current_item = items[index]
While new_index >0 AND items[new_index -1]> current_item //correct position not yet found
Function insertionSort(items)
End function
Return items
items[new_index]= items[new_index -1]//shuffle item across
Endwhile
EndFor
items[new_index]= current_item //place item in correct position