no of comparisons in merge sort max?
how many max no swaps??[if inplace algo]
https://stackoverflow.com/questions/8535540/exactly-how-many-comparisons-does-merge-sort-make
in the worst case n^2 swaps.
max. swap occur when array will be like this [(3,4),(1,2)] or [(5,6,7,8)(1,2,3,4)].
https://www.geeksforgeeks.org/in-place-merge-sort/ (use this algo to calculate no. of swaps).
Correct me if i'm wrong?
64.3k questions
77.9k answers
244k comments
80.0k users