Swaps in bubble sort

[3, 1, 2] → 2

You can also choose a level by clicking its number.

About the course

Description
How many swaps of neighboring elements bubble sort makes (the number of inversions in the array)
More information
Arrays are indexed from zero. Sorting is ascending (from the smallest) unless stated otherwise.
Sample question
[3, 1, 2] → 2
Author
Jiří Preisler
Version
1.0