Insertion Sort Visualizer

COSC 2306: Data Programming - Partitioning Strategy

Current Pass --
Press "Step Forward" to begin partitioning the array.

Algorithm Trace

# Insertion Sort ready.
# Goal: Partition into Sorted and Unsorted regions.

Controls

Python Implementation
def insertion_sort(a_list):
    for index in range(1, len(a_list)):
        current_value = a_list[index]
        position = index
        while position > 0 and a_list[position-1] > current_value:
            a_list[position] = a_list[position-1]
            position = position - 1
        a_list[position] = current_value