Follow every comparison and swap as bubble sort transforms a disordered dataset into ascending order.
Bubble sort repeatedly compares adjacent values and swaps them when they are out of order. Each pass moves the largest remaining value toward the end of the array. The algorithm is easy to visualise, although its average time complexity is O(n²).