CSS3 for Algorithm Visualization Demo: BubbleSort

This is a demo of using CSS3 transitions and transformations for visualizing sorting algorithms, more specifically BubbleSort. 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 selection sort demo.

← Backward Forward →

def bubble_sort(arr):
  for i in range(0,len(arr)-1):
    for j in range(1, len(arr) - i):
      if (arr[j-1] > arr[j]): 
        arr.swap(j-1, j)

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