02/21/00
COM1100 Winter2000 Yuhong Yin
11
Bubble Sort
n
Exchange adjacent pairs of elements that are
out of order
n
Largest value “sinks” to the bottom each
pass, while smaller values gradually “bubble” up
to the top
n