So wherever the largest element started out in the list, by the time I get through it, it's at the end.
所以无论最大的元素,在列表的什么位置。
OK. The next largest element has to end up in the second last spot. Et cetera. All right, so it's called bubble sort because it does this bubbling up until it gets there.
好的,下一个最大元素又,能跑到倒数第二的位置,等等如此,好的,这称为冒泡排序,因为这个泡泡一直冒到他自己的位置。
应用推荐