def
bubble_sort(a)
(a.size-
2
).downto(
0
)
do
|i|
(
..i).
each
|j|
a[j], a[j+
1
] = a[j+
], a[j]
if
a[j] > a[j+
]
end
return
a