Solveeit Logo

Question

Computer Science Question on Sorting

__________ compares neighboring elements only and swaps them when necessary?

A

Selection Sort

B

Bubble Sort

C

Insertion Sort

D

Quick Sort

Answer

Bubble Sort

Explanation

Solution

Bubble Sort compares and swaps adjacent elements if they are in the wrong order, repeating until the list is sorted.