דלג לתוכן

בירור בועות

Put the smallest time first

  • Four heights sit in an array. 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

חומר עזר

היכנס או צור חשבון

IGCSE, A-Level & AP