Skip to content · ⁨본문 바로가기⁩

Bubble sort · ⁨버블 정렬⁩

Put the smallest time first

  • Three race times sit in an array: 14, 9, 11. The smallest should come first.
  • Compare each pair of neighbours. When the left one is larger, swap them.
  • That single comparison does not finish the list. The next pair is compared after it.

Bubble sort compares neighbours: 14 is larger than 9, so those two swap; 11 is not in this comparison

Handout · ⁨교재 자료⁩

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP