Interactive animations
 

Interactive animations

for teaching algorithms and programming

 

Simple exchange sort

This animation shows the simplesort sorting algorithm. We compare every element with every other
element located behind it. If the compared elements are not in ascending order, we swap them.

Bubblesort

This animation shows the bubblesort algorithm. We compare every element with its right neighbour.
If the compared elements are not in ascending order, we swap them.

Improved bubblesort

This animation shows an improved bubblesort algorithm. In this algorithm, we remember the
place of the last swap (ch) after each iterration. In next iteration we don't check again those
elements, which are already in sorted order (on the right from the place of the last swap).

Insertion sort

This animation shows the insertsort algorithm. We move every element to its place on the left.

Improved insertion sort

This animation shows an improved insertsort algorithm. First, we copy every element to a temporary
(tmp) variable. Next, we move the sorted, green part of the array to the right until we find the place
of the removed element. Finally, we put back the removed element from tmp to its right place.

Selectsort: Minsort

This animation shows the minsort algorithm, which is one type of selectsort algorithms. First, we find
the index of the smallest element (min) in the unsorted part of the array (red colored columns).
Next, we swapped the found element with the first element of the unsorted part.

Selectsort: Maxsort

This animation shows the maxsort algorithm, which is one type of selectsort algorithms. First, we find
the index of the biggest element (max) in the unsorted part of the array (red colored columns).
Next, we swapped the found element with the last element of the unsorted part.


 
(C) 2012-2020, Ladislav Végh, Komárno, Slovakia