Teaching Rajasthan Basic Computer Instructor 2021 Mock Test Algorithms Searching, Sorting and Hashing Sorting
How many swaps are there in the bubble sort in worst case and best case respectively?
Consider total number of elements are n.
1
n(n-1)/2 and zero
2
n(n-1)/2 and n
3
n and n2
4
n and n