Bubble sort works by:
-
A
Dividing the list
-
B
Swapping adjacent elements
Correct answer
-
C
Searching for a value
-
D
Merging lists
Correct answer
B. Swapping adjacent elements
11 views
Explanation
Bubble sort repeatedly compares adjacent elements and swaps them if they are in the wrong order. Larger elements “bubble” to the end.
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ