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

BEBRAS 2018 Grade 7-8 Round 2 Ext Question 9

BEBRAS · BEBRAS 2018 Grade 7-8 Round 2 Ext

Question 9

NUMO sorts a row of numbers. In each pass, it activates buttons from START to END. A button compares the two numbers immediately below it: if the left number is at most the right, it does nothing; otherwise it swaps them, then proceeds. Passes continue until the row is increasing from left to right.

Question illustration

Question illustration

Bubble says that each new pass can stop one button earlier than the previous pass, making sorting faster. Which statement is correct?
  1. Bubble is wrong: the machine would no longer work correctly.
  2. The machine should skip the leftmost button after each pass.
  3. Bubble is right: the machine will work faster.
  4. Bubble is wrong: sorting time is unchanged.