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

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation