How many swaps are required to sort the given array using bubble sort - { 2,…
2023
How many swaps are required to sort the given array using bubble sort - { 2, 5, 1, 3, 4}
- A.
4
- B.
5
- C.
6
- D.
7
Attempted by 201 students.
Show answer & explanation
Correct answer: A
Answer : A
Explanation
There will be 3 swaps in first iteration and 1 swap in second iteration.