Computer Science for IGCSE & O level - Algorithm Design And Problem Solving (Section 8 - No. 26)

In the bubble sort algorithm, what causes a swap of two numbers?
The values are equal.
The value of index is an odd number.
The second value in the list is greater than the first.
The values are in the incorrect order.

Explanation

Two values are swapped if they are in the wrong order, for example, one is greater than the other and they're in the wrong sequence.

Comments (0)

Advertisement