Skip to content / Đến nội dung
ThichHocToan.com

BEBRAS 2023 Grade 7-8 Round 2 Ext Question 4

BEBRAS · BEBRAS 2023 Grade 7-8 Round 2 Ext

Question 4

Each beaver holds a number card. They sort themselves into increasing order from left to right. Compare the first two beavers and swap them if the first number is larger. Then compare the second and third, then the third and fourth, and so on. After the rightmost pair, restart from the left. Stop only after a full pass with no swap. The example sorts 8,5,4.

Question illustration

Starting with the five beavers below, how many swaps are needed?

Question illustration
  1. 5
  2. 6
  3. 7
  4. 8