Which of the following best describes Bubble sort?
- A. An algorithm that finds the shortest path between nodes in a graph with non-negative edge weights.
- B. A divide-and-conquer sorting algorithm that splits the array, sorts each half, and merges them.
- C. A simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order. ✓
- D. A mathematical notation used to describe the upper bound of an algorithm's time or space complexity.
Correct answer
C. A simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order.
Explanation
Bubble sort refers to a simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order.