In this experiment, you need to follow the Bubblesort algorithm by stepping through it.
In this experiment, there is just one control called Next. The machine now has another state variable b, called the boundary variable, which keeps track of the portion of the list already sorted.
The Next button performs the next step in the Bubblesort algorithm. The next step advances the variable i, ordering the element at i and its right neighbour. It resets i if i reaches b-1 and also decrements b.
Follow the given steps to perform the experiment.