Bubble Machine

Objective

Sort the given list by performing adjacent ordering operation using bubble and reset to select the pairs.

Experiment Setup

The Bubble Machine has two controls: Bubble and Reset. It also has a state variable i, which keeps track of which two elements to compare. Pressing the Bubble button increment i. It also orders the elements if they are out of order, otherwise it leaves them unchanged. The Reset control takes the current index back to 0.

Procedure

Follow the given steps to perform the experiment.

  1. Click the Bubble button to advance through the list.
  2. Hit Reset to return to the beginning of the list.
  3. Check if the list is sorted or not. Repeat steps 1 and 2 until the list is sorted.