Swap neighbors that are out of order, pass after pass, until no pair is left.
This interactive visualization needs JavaScript.