Multiple choice

A bubble sort compares _______ elements.

  1. contrasting

  2. first and last

  3. even numbered

  4. adjacent

Reveal answer Fill a bubble to check yourself
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.