............ compares neighbouring elements only and swaps them when necessary.
2025
............ compares neighbouring elements only and swaps them when necessary.
Answer: B. Bubble Sort — 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)…
- A.
Selection Sort
- B.
Bubble Sort
- C.
Insertion Sort
- D.
Quick Sort
Attempted by 969 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.
Loading lesson…