............ compares neighbouring elements only and swaps them when necessary.
2025
............ compares neighbouring elements only and swaps them when necessary.
- A.
Selection Sort
- B.
Bubble Sort
- C.
Insertion Sort
- D.
Quick Sort
Attempted by 653 students.
Show answer & explanation
Correct answer: B
The correct answer is Bubble Sort. This algorithm works by repeatedly stepping through the list to be sorted. It compares each pair of adjacent (neighboring) elements. If they are in the wrong order, it swaps them. This process is repeated until no swaps are needed, indicating the list is sorted.