Thompson Thompson - 25 days ago 15
C++ Question

Exchange sort number of comparisons and exchanges

I just have a simple question for the day, I have been looking online for some sort of formula that calculates the number of comparisons and exchanges for exchange sort. I know for selection sort the average number of comparisons would be n(n-1)/2

Answer

According to this page, exchange sort has a time complexity of O(n^2).

Comments