Sorts elements through repeated adjacent comparisons.