CSS3 for Algorithm Visualization Demo: Selection Sort

This is a demo of using CSS3 transitions and transformations for visualizing sorting algorithms, more specifically Selection Sort. You'll need to have a browser that supports CSS3 transitions and transformations, such as a recent version of Chrome of Safari. Read the blog post for more details. And also check out the bubble sort demo.

← Backward Forward →

def selection_sort(arr):
  for i in range(0, len(arr)-1):
    min = i;
    for j in range(i+1, len(arr)):
      if arr[j] < arr[min]:
        min = j;
    arr.swap(min, i)

11
3
2
1
8
4
  • Variables:
  • i =
  • j =
  • min =