A bubble sort compares _______ elements.
-
contrasting
-
first and last
-
even numbered
-
adjacent
D
Correct answer
Explanation
Bubble sort is named because it works by repeatedly stepping through the list, comparing adjacent elements and swapping them if they're in the wrong order. This process causes smaller values to 'bubble up' to the top of the list like bubbles rising in water, hence the algorithm's name.